UNPKG

@oxyhq/services

Version:

Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀

20 lines (19 loc) • 705 B
"use strict"; /** * Custom error types for better error handling */ export class OxyAuthenticationError extends Error { constructor(message, code = 'AUTH_ERROR', status = 401) { super(message); this.name = 'OxyAuthenticationError'; this.code = code; this.status = status; } } export class OxyAuthenticationTimeoutError extends OxyAuthenticationError { constructor(operationName, timeoutMs) { super(`Authentication timeout (${timeoutMs}ms): ${operationName} requires user authentication. Please ensure the user is logged in before calling this method.`, 'AUTH_TIMEOUT', 408); this.name = 'OxyAuthenticationTimeoutError'; } } //# sourceMappingURL=OxyServices.errors.js.map