Errors
The base error every failed request throws, and its status-specific subclasses.
Exports of @crouter/sdk, read from the TypeScript compiler at build time. Types re-exported from @crouter/api are documented with that package.
APIConnectionError
class declared in errors.ts
The daemon could not be reached, or the connection failed mid-request.
Prop
Type
APIConnectionTimeoutError
class declared in errors.ts
The request exceeded its timeout before the daemon answered.
Prop
Type
APIUserAbortError
class declared in errors.ts
The caller's AbortSignal fired.
Prop
Type
AuthenticationError
class declared in errors.ts
The token was missing or wrong: HTTP 401.
Prop
Type
BadRequestError
class declared in errors.ts
The daemon rejected the request: HTTP 400.
Prop
Type
ConflictError
class declared in errors.ts
The resource is in a state that forbids the request: HTTP 409.
Prop
Type
CrouterError
class declared in errors.ts
An SDK configuration or protocol error, raised by the SDK itself. Its code is an SdkErrorCode.
Prop
Type
InternalServerError
class declared in errors.ts
The daemon failed while handling the request: HTTP 500 and above.
Prop
Type
mapError
function declared in errors.ts
Maps a transport failure or a plain APIError onto the specific class for its status and code.
(error: unknown) => APIErrorNotFoundError
class declared in errors.ts
No such node, profile, cron, or other resource: HTTP 404.
Prop
Type
PermissionDeniedError
class declared in errors.ts
The caller is not allowed to do this: HTTP 403.
Prop
Type
RateLimitError
class declared in errors.ts
Too many requests: HTTP 429.
Prop
Type
SdkErrorCode
type declared in error-codes.ts
A code the SDK raises itself. An APIError's code is one of these or an ErrorCode from the contract.
"connection_error" | "crouter_error" | "daemon_health_unavailable" | "daemon_request_interrupted" | "daemon_unavailable" | "id_token_invalid" | "invalid_response" | "oauth_exchange_mismatch" | "oauth_nonce_missing" | "oauth_state_mismatch" | "request_aborted" | "request_timeout" | "run_idle" | "stream_ended" | "stream_error" | "transport_error" | "waiting_on_user"sdkErrorCodes
variable declared in error-codes.ts
Codes the SDK raises itself rather than reading from a daemon or directory response.
Prop
Type
UnprocessableEntityError
class declared in errors.ts
The request was well-formed but unusable, or too large: HTTP 413 and 422.
Prop
Type