errors
AbstractNylasApiError
Bases: Exception
Base class for all Nylas API errors.
Attributes:
Name | Type | Description |
---|---|---|
request_id |
Optional[str]
|
The unique identifier of the request. |
status_code |
Optional[int]
|
The HTTP status code of the error response. |
headers |
Optional[CaseInsensitiveDict]
|
The headers returned from the API. |
Source code in nylas/models/errors.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
__init__(message, request_id=None, status_code=None, headers=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_id |
Optional[str]
|
The unique identifier of the request. |
None
|
status_code |
Optional[int]
|
The HTTP status code of the error response. |
None
|
message |
str
|
The error message. |
required |
Source code in nylas/models/errors.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
AbstractNylasSdkError
Bases: Exception
Base class for all Nylas SDK errors.
Source code in nylas/models/errors.py
37 38 39 40 41 42 |
|
NylasApiError
Bases: AbstractNylasApiError
Class representation of a general Nylas API error.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
Error type. |
provider_error |
Optional[dict]
|
Provider Error. |
headers |
CaseInsensitiveDict
|
The headers returned from the API. |
Source code in nylas/models/errors.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
__init__(api_error, status_code=None, headers=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_error |
NylasApiErrorResponse
|
The error details from the API. |
required |
status_code |
Optional[int]
|
The HTTP status code of the error response. |
None
|
Source code in nylas/models/errors.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
NylasApiErrorResponse
dataclass
Interface representing the error response from the Nylas API.
Attributes:
Name | Type | Description |
---|---|---|
request_id |
Optional[str]
|
The unique identifier of the request. |
error |
NylasApiErrorResponseData
|
The error data. |
Source code in nylas/models/errors.py
62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
NylasApiErrorResponseData
dataclass
Interface representing the error data within the response object.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
The type of error. |
message |
str
|
The error message. |
provider_error |
Optional[dict]
|
The provider error if there is one. |
Source code in nylas/models/errors.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
NylasNetworkError
Bases: AbstractNylasSdkError
Error thrown when the SDK receives a non-JSON response with an error status code. This typically happens when the request never reaches the Nylas API due to infrastructure issues (e.g., proxy errors, load balancer failures).
Note: This error class will be used in v7.0 to replace NylasApiError for non-JSON HTTP error responses. Currently, non-JSON errors still throw NylasApiError with type="network_error" for backwards compatibility.
Attributes:
Name | Type | Description |
---|---|---|
request_id |
Optional[str]
|
The unique identifier of the request. |
status_code |
Optional[int]
|
The HTTP status code of the error response. |
raw_body |
Optional[str]
|
The non-JSON response body. |
headers |
Optional[CaseInsensitiveDict]
|
The headers returned from the server. |
flow_id |
Optional[str]
|
The value from x-fastly-id header if present. |
Source code in nylas/models/errors.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
__init__(message, request_id=None, status_code=None, raw_body=None, headers=None, flow_id=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
The error message. |
required |
request_id |
Optional[str]
|
The unique identifier of the request. |
None
|
status_code |
Optional[int]
|
The HTTP status code of the error response. |
None
|
raw_body |
Optional[str]
|
The non-JSON response body. |
None
|
headers |
Optional[CaseInsensitiveDict]
|
The headers returned from the server. |
None
|
flow_id |
Optional[str]
|
The value from x-fastly-id header if present. |
None
|
Source code in nylas/models/errors.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
NylasOAuthError
Bases: AbstractNylasApiError
Class representation of an OAuth error returned by the Nylas API.
Attributes:
Name | Type | Description |
---|---|---|
error |
str
|
Error type. |
error_code |
int
|
Error code used for referencing the docs, logs, and data stream. |
error_description |
str
|
Human readable error description. |
error_uri |
str
|
URL to the related documentation and troubleshooting regarding this error. |
Source code in nylas/models/errors.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
__init__(oauth_error, status_code=None, headers=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
oauth_error |
NylasOAuthErrorResponse
|
The error details from the API. |
required |
status_code |
Optional[int]
|
The HTTP status code of the error response. |
None
|
Source code in nylas/models/errors.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
NylasOAuthErrorResponse
dataclass
Interface representing an OAuth error returned by the Nylas API.
Attributes:
Name | Type | Description |
---|---|---|
error |
str
|
Error type. |
error_code |
int
|
Error code used for referencing the docs, logs, and data stream. |
error_description |
str
|
Human readable error description. |
error_uri |
str
|
URL to the related documentation and troubleshooting regarding this error. |
Source code in nylas/models/errors.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
NylasSdkTimeoutError
Bases: AbstractNylasSdkError
Error thrown when the Nylas SDK times out before receiving a response from the server.
Attributes:
Name | Type | Description |
---|---|---|
url |
str
|
The URL that timed out. |
timeout |
int
|
The timeout value set in the Nylas SDK, in seconds. |
Source code in nylas/models/errors.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
__init__(url, timeout, headers=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
The URL that timed out. |
required |
timeout |
int
|
The timeout value set in the Nylas SDK, in seconds. |
required |
Source code in nylas/models/errors.py
160 161 162 163 164 165 166 167 168 169 170 171 |
|