Skip to main content

Class: RefreshTokenError

Defined in: src/auth/errors.ts:235

Refresh token error.

Remarks​

Thrown when refresh token is invalid or reused. HTTP mapping: 401 Unauthorized

Extends​

Constructors​

new RefreshTokenError()​

new RefreshTokenError(refreshError, message): RefreshTokenError

Defined in: src/auth/errors.ts:249

Creates a new RefreshTokenError.

Parameters​

refreshError​

Specific error type

"revoked" | "expired" | "invalid" | "reused"

message​

string

Error message

Returns​

RefreshTokenError

Overrides​

ChiveError.constructor

Properties​

cause?​

readonly optional cause: Error

Defined in: src/types/errors.ts:71

Original error that caused this error (if any).

Remarks​

Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.

Example​

try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}

Inherited from​

ChiveError.cause


code​

readonly code: "REFRESH_TOKEN_ERROR" = 'REFRESH_TOKEN_ERROR'

Defined in: src/auth/errors.ts:236

Machine-readable error code.

Remarks​

Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).

Overrides​

ChiveError.code


refreshError​

readonly refreshError: "revoked" | "expired" | "invalid" | "reused"

Defined in: src/auth/errors.ts:241

Specific refresh token error.