Errors¶
Every exception raised by the client subclasses
LinearError.
Exception types raised by the Linear client.
LinearAuthenticationError
¶
Bases: LinearError
Raised when the API rejects the supplied credentials.
Triggered by HTTP 401/403 responses or GraphQL errors with codes
AUTHENTICATION_ERROR, UNAUTHENTICATED, or FORBIDDEN.
LinearRateLimitError
¶
LinearRateLimitError(
message: str,
*,
requests_limit: int | None = None,
requests_remaining: int | None = None,
requests_reset: int | None = None,
complexity_limit: int | None = None,
complexity_remaining: int | None = None,
complexity_reset: int | None = None,
query_complexity: int | None = None,
endpoint_requests_limit: int | None = None,
endpoint_requests_remaining: int | None = None,
endpoint_requests_reset: int | None = None,
endpoint_name: str | None = None,
)
Bases: LinearError
Raised when a request is rejected for exceeding a rate limit.
Linear signals rate limiting with an HTTP 400 response whose GraphQL error
carries the RATELIMITED code. Request-level and complexity-level
X-RateLimit-* headers are exposed as attributes when present (otherwise
None). When an endpoint-specific limit was hit, the endpoint_*
attributes identify which limit and endpoint were exceeded.
Attributes:
| Name | Type | Description |
|---|---|---|
requests_limit |
Max requests allowed in the current window. |
|
requests_remaining |
Requests left in the current window. |
|
requests_reset |
Window reset time (UTC epoch milliseconds). |
|
complexity_limit |
Max complexity points allowed in the current window. |
|
complexity_remaining |
Complexity points left in the current window. |
|
complexity_reset |
Complexity window reset time (UTC epoch milliseconds). |
|
query_complexity |
Complexity score of the request that was rejected
(from the |
|
endpoint_requests_limit |
Per-endpoint request cap (when an endpoint-specific limit was hit). |
|
endpoint_requests_remaining |
Requests remaining for the endpoint. |
|
endpoint_requests_reset |
Endpoint window reset time (UTC epoch ms). |
|
endpoint_name |
Identifies which endpoint triggered the limit. |
Source code in src/linear_python_client/errors.py
LinearGraphQLError
¶
Bases: LinearError
Raised when the API returns one or more GraphQL errors.
The raw error list returned by the API is available as errors, and the
code of the first error carrying one (if any) is exposed via code.
Attributes:
| Name | Type | Description |
|---|---|---|
errors |
list[dict[str, Any]]
|
The raw GraphQL error objects returned by the API. |
Source code in src/linear_python_client/errors.py
LinearNetworkError
¶
Bases: LinearError
Raised when the request fails to reach the API or returns an unexpected response.
LinearServerError
¶
Bases: LinearError
Raised when the Linear API returns an HTTP 5xx response.
Indicates a server-side failure unrelated to the request itself. These are transient in most cases; callers should back off and retry.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
The HTTP status code returned (500–599). |
|
body_preview |
Up to 300 characters of the raw response body, useful for diagnosing gateway or proxy errors that return non-JSON payloads. |