Skip to main content

Class: SessionRevokedError

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

Session revoked error.

Remarks​

Thrown when attempting to use a revoked session. HTTP mapping: 401 Unauthorized

Extends​

Constructors​

new SessionRevokedError()​

new SessionRevokedError(sessionId): SessionRevokedError

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

Creates a new SessionRevokedError.

Parameters​

sessionId​

string

Revoked session ID

Returns​

SessionRevokedError

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: "SESSION_REVOKED" = 'SESSION_REVOKED'

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

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


sessionId​

readonly sessionId: string

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

Session ID that was revoked.