Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 10 | # implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
Alex Gaynor | c37feed | 2014-03-08 08:32:56 -0800 | [diff] [blame] | 14 | from __future__ import absolute_import, division, print_function |
| 15 | |
Alex Gaynor | 738ac5a | 2013-11-02 14:10:38 -0700 | [diff] [blame] | 16 | |
Alex Stapleton | 112963e | 2014-03-26 17:39:29 +0000 | [diff] [blame] | 17 | class _Reasons(object): |
| 18 | BACKEND_MISSING_INTERFACE = object() |
Alex Stapleton | f33ccfcc | 2014-03-26 17:44:14 +0000 | [diff] [blame^] | 19 | UNSUPPORTED_HASH = object() |
| 20 | UNSUPPORTED_CIPHER = object() |
| 21 | UNSUPPORTED_PADDING = object() |
Alex Gaynor | 7a489db | 2014-03-22 15:09:34 -0700 | [diff] [blame] | 22 | |
| 23 | |
Alex Gaynor | 25d24de | 2014-03-01 09:36:02 -0800 | [diff] [blame] | 24 | class UnsupportedAlgorithm(Exception): |
Alex Gaynor | 7a489db | 2014-03-22 15:09:34 -0700 | [diff] [blame] | 25 | def __init__(self, message, cause=None): |
| 26 | super(UnsupportedAlgorithm, self).__init__(message) |
| 27 | self._cause = cause |
David Reid | 152d6be | 2013-11-12 16:41:13 -0800 | [diff] [blame] | 28 | |
| 29 | |
| 30 | class AlreadyFinalized(Exception): |
| 31 | pass |
Paul Kehrer | 22e80cb | 2013-11-20 21:27:00 -0600 | [diff] [blame] | 32 | |
| 33 | |
Paul Kehrer | ce9c611 | 2013-11-22 14:10:59 -0600 | [diff] [blame] | 34 | class AlreadyUpdated(Exception): |
| 35 | pass |
| 36 | |
| 37 | |
Paul Kehrer | cc9ec98 | 2013-11-21 11:21:35 -0600 | [diff] [blame] | 38 | class NotYetFinalized(Exception): |
Paul Kehrer | 22e80cb | 2013-11-20 21:27:00 -0600 | [diff] [blame] | 39 | pass |
Paul Kehrer | a4bfc08 | 2013-11-22 19:57:37 -0600 | [diff] [blame] | 40 | |
| 41 | |
| 42 | class InvalidTag(Exception): |
| 43 | pass |
Julian Krause | 2288e30 | 2013-12-17 21:26:23 -0800 | [diff] [blame] | 44 | |
| 45 | |
| 46 | class InvalidSignature(Exception): |
| 47 | pass |
Alex Gaynor | 0d62fb0 | 2014-01-24 12:19:05 -0600 | [diff] [blame] | 48 | |
| 49 | |
| 50 | class InternalError(Exception): |
| 51 | pass |
Alex Gaynor | b2774f5 | 2014-01-27 11:05:29 -0800 | [diff] [blame] | 52 | |
| 53 | |
| 54 | class InvalidKey(Exception): |
| 55 | pass |
Ayrx | a776911 | 2014-02-13 12:27:56 +0800 | [diff] [blame] | 56 | |
| 57 | |
| 58 | class InvalidToken(Exception): |
| 59 | pass |