Skip to content

Commit 232aa11

Browse files
committed
add 405 exception
1 parent 3cd2a2c commit 232aa11

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
@@ -9,8 +9,8 @@
99
from .restful_model_collection import RestfulModelCollection
1010
from .restful_models import Namespace, File, Account
1111
from .errors import (APIClientError, ConnectionError, NotAuthorizedError,
12-
InvalidRequestError, NotFoundError, ServerError,
13-
ServiceUnavailableError, ConflictError,
12+
InvalidRequestError, NotFoundError, MethodNotSupportedError,
13+
ServerError, ServiceUnavailableError, ConflictError,
1414
SendingQuotaExceededError, ServerTimeoutError,
1515
MessageRejectedError)
1616

@@ -24,6 +24,7 @@ def _validate(response):
2424
402: MessageRejectedError,
2525
403: NotAuthorizedError,
2626
404: NotFoundError,
27+
405: MethodNotSupportedError,
2728
409: ConflictError,
2829
429: SendingQuotaExceededError,
2930
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)