UNPKG

jsm-exceptions

Version:

A comprehensive TypeScript exception library with HTTP status code support, detailed JSDoc documentation, and backward compatibility. Provides structured error handling for web applications and APIs.

32 lines (31 loc) 1.02 kB
import BaseException from "./base.exception"; /** * @fileoverview JWT Token Expired exception (HTTP 401) * @author dr. Salmi <reevosolutions@gmail.com> */ /** * Exception thrown when a JWT token has expired. * Corresponds to HTTP 401 Unauthorized status code. * * @class JWTTokenExpiredException * @extends {BaseException} * @example * ```typescript * throw new JWTTokenExpiredException('Access token has expired'); * throw new JWTTokenExpiredException('Token expired', { * tokenType: 'refresh', * expiredAt: '2025-07-22T10:30:00Z' * }); * ``` */ declare class JWTTokenExpiredException extends BaseException { /** * Creates an instance of JWTTokenExpiredException. * * @param {string} [message='JWT Token expired'] - The error message * @param {Record<string, any>} [context] - Additional context about the expired token * @memberof JWTTokenExpiredException */ constructor(message?: string, context?: Record<string, any>); } export default JWTTokenExpiredException;