ErrorCode
ErrorCode:
object
Defined in: packages/core/src/errors.ts:9
Companion object for the ErrorCode type. Provides category helpers for error classification in monitoring and alerting.
Type Declaration
Section titled “Type Declaration”isAuth()
Section titled “isAuth()”
readonlyisAuth: (code) =>boolean
Whether the error code represents an authentication failure.
Parameters
Section titled “Parameters”the error code to check
Returns
Section titled “Returns”boolean
true if the code is an auth error
isClientError()
Section titled “isClientError()”
readonlyisClientError: (code) =>boolean
Whether the error code represents a client-side error (validation, not found).
Parameters
Section titled “Parameters”the error code to check
Returns
Section titled “Returns”boolean
true if the code is a client error
isNetwork()
Section titled “isNetwork()”
readonlyisNetwork: (code) =>boolean
Whether the error code represents a network-level failure.
Parameters
Section titled “Parameters”the error code to check
Returns
Section titled “Returns”boolean
true if the code is a network error
isRateLimit()
Section titled “isRateLimit()”
readonlyisRateLimit: (code) =>boolean
Whether the error code represents a rate limiting issue.
Parameters
Section titled “Parameters”the error code to check
Returns
Section titled “Returns”boolean
true if the code is a rate limit error
Example
Section titled “Example”if (ErrorCode.isNetwork(error.code)) { ... }