OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
2 # | 2 # |
3 # Copyright 2014 Google Inc. All Rights Reserved. | 3 # Copyright 2014 Google Inc. All Rights Reserved. |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
11 # Unless required by applicable law or agreed to in writing, software | 11 # Unless required by applicable law or agreed to in writing, software |
12 # distributed under the License is distributed on an "AS IS" BASIS, | 12 # distributed under the License is distributed on an "AS IS" BASIS, |
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 # See the License for the specific language governing permissions and | 14 # See the License for the specific language governing permissions and |
15 # limitations under the License. | 15 # limitations under the License. |
16 | 16 |
17 """Errors for the library. | 17 """Errors for the library. |
18 | 18 |
19 All exceptions defined by the library | 19 All exceptions defined by the library |
20 should be defined in this file. | 20 should be defined in this file. |
21 """ | 21 """ |
22 | 22 |
23 __author__ = 'jcgregorio@google.com (Joe Gregorio)' | 23 __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
24 | 24 |
25 import json | 25 import json |
26 | 26 |
27 from ...oauth2client import util | 27 from third_party.oauth2client import util |
28 | 28 |
29 | 29 |
30 class Error(Exception): | 30 class Error(Exception): |
31 """Base error for this module.""" | 31 """Base error for this module.""" |
32 pass | 32 pass |
33 | 33 |
34 | 34 |
35 class HttpError(Error): | 35 class HttpError(Error): |
36 """HTTP data was invalid or unexpected.""" | 36 """HTTP data was invalid or unexpected.""" |
37 | 37 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 'Received unexpected call %s' % methodId) | 131 'Received unexpected call %s' % methodId) |
132 | 132 |
133 | 133 |
134 class UnexpectedBodyError(Error): | 134 class UnexpectedBodyError(Error): |
135 """Exception raised by RequestMockBuilder on unexpected bodies.""" | 135 """Exception raised by RequestMockBuilder on unexpected bodies.""" |
136 | 136 |
137 def __init__(self, expected, provided): | 137 def __init__(self, expected, provided): |
138 """Constructor for an UnexpectedMethodError.""" | 138 """Constructor for an UnexpectedMethodError.""" |
139 super(UnexpectedBodyError, self).__init__( | 139 super(UnexpectedBodyError, self).__init__( |
140 'Expected: [%s] - Provided: [%s]' % (expected, provided)) | 140 'Expected: [%s] - Provided: [%s]' % (expected, provided)) |
OLD | NEW |