Skip to content

Commit ac18cd2

Browse files
author
Ethan Blackburn
committed
Merge pull request #9 from mmautner/add-405-handling
add 405 exception
2 parents 6dd4102 + 232aa11 commit ac18cd2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

nylas/client/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from .restful_models import (Calendar, Contact, Event, Message, Thread, File,
1212
Account, APIAccount, Tag, Folder, Label, Draft)
1313
from .errors import (APIClientError, ConnectionError, NotAuthorizedError,
14-
InvalidRequestError, NotFoundError, ServerError,
15-
ServiceUnavailableError, ConflictError,
14+
InvalidRequestError, NotFoundError, MethodNotSupportedError,
15+
ServerError, ServiceUnavailableError, ConflictError,
1616
SendingQuotaExceededError, ServerTimeoutError,
1717
MessageRejectedError)
1818

@@ -26,6 +26,7 @@ def _validate(response):
2626
402: MessageRejectedError,
2727
403: NotAuthorizedError,
2828
404: NotFoundError,
29+
405: MethodNotSupportedError,
2930
409: ConflictError,
3031
429: SendingQuotaExceededError,
3132
500: ServerError,

nylas/client/errors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class NotFoundError(APIClientError):
4747
pass
4848

4949

50+
class MethodNotSupportedError(APIClientError):
51+
pass
52+
53+
5054
class ServerError(APIClientError):
5155
pass
5256

0 commit comments

Comments
 (0)