@wristband/express-auth
Version:
SDK for integrating your ExpressJS application with Wristband. Handles user authentication, session management, and token management.
22 lines (21 loc) • 765 B
JavaScript
/**
* Represents a structured error from the Wristband SDK.
*
* Wraps an error code, an optional description, and optionally the original underlying Error.
*/
export class WristbandError extends Error {
/**
* Creates a new WristbandError instance.
*
* @param code - A short error code or identifier.
* @param errorDescription - Optional human-readable description of the error.
* @param originalError - Optional original Error instance that caused this error.
*/
constructor(code, errorDescription, originalError) {
super(errorDescription || code);
this.name = 'WristbandError';
this.code = code;
this.errorDescription = errorDescription;
this.originalError = originalError;
}
}