Skip to content

Commit 8856142

Browse files
committed
Bringing the errors section up-to-date.
1 parent 3657841 commit 8856142

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,19 @@ Note that models generated from webhook notifications might differ slightly from
393393
### Errors
394394
You do not need to deal with the HTTP response from an API call directly. If there is an unsuccessful response then an error that is a subclass of `intercom.Error` will be raised. If desired, you can get at the http_code of an `Error` via it's `http_code` method.
395395

396-
The list of different error subclasses are listed below. As they all inherit off `Error` you can choose to except `Error` or the more specific error subclass:
396+
The list of different error subclasses are listed below. As they all inherit off `IntercomError` you can choose to except `IntercomError` or the more specific error subclass:
397397

398398
```python
399399
AuthenticationError
400400
ServerError
401401
ServiceUnavailableError
402402
ResourceNotFound
403+
BadGatewayError
403404
BadRequestError
404405
RateLimitExceeded
405-
AttributeNotSetError # Raised when you try to call a getter that does not exist on an object
406+
MultipleMatchingUsersError
407+
HttpError
408+
UnexpectedError
406409
```
407410

408411

intercom/errors.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# -*- coding: utf-8 -*-
22

33

4-
class ArgumentError(ValueError):
5-
pass
6-
7-
8-
class HttpError(Exception):
9-
pass
10-
11-
124
class IntercomError(Exception):
135

146
def __init__(self, message=None, context=None):
@@ -17,6 +9,14 @@ def __init__(self, message=None, context=None):
179
self.context = context
1810

1911

12+
class ArgumentError(ValueError, IntercomError):
13+
pass
14+
15+
16+
class HttpError(IntercomError):
17+
pass
18+
19+
2020
class ResourceNotFound(IntercomError):
2121
pass
2222

0 commit comments

Comments
 (0)