UNPKG

@thalorlabs/errors

Version:

Enhanced exception handling system for TypeScript applications with comprehensive error classes and debugging capabilities

16 lines (15 loc) 645 B
import CustomError from './CustomError'; /** * Error for authentication failures and unauthorized access. * * Used when users attempt to access resources without proper authentication. * Provides clear 401 error responses with optional authentication context. * * @example * throw new UnauthorizedError('Invalid credentials', 'token-expired', 'req-123'); * * throw new UnauthorizedError('Authentication required', null, 'req-456', { endpoint: '/api/admin' }); */ export declare class UnauthorizedError extends CustomError { constructor(message?: string, error?: string | null, requestId?: string, context?: Record<string, any>); }