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.

31 lines (30 loc) 1.08 kB
import BaseException from "./base.exception"; /** * @fileoverview Invalid Password exception (HTTP 401) * @author dr. Salmi <reevosolutions@gmail.com> */ /** * Exception thrown when password authentication fails. * Corresponds to HTTP 401 Unauthorized status code (changed from 403 for consistency). * * @class InvalidPasswordException * @extends {BaseException} * @example * ```typescript * throw new InvalidPasswordException('Password is incorrect'); * throw new InvalidPasswordException('Password does not meet requirements', { * requirements: ['minLength', 'uppercase'] * }); * ``` */ declare class InvalidPasswordException extends BaseException { /** * Creates an instance of InvalidPasswordException. * * @param {string} [message='Invalid password'] - The error message * @param {Record<string, any>} [context] - Additional context about the password validation failure * @memberof InvalidPasswordException */ constructor(message?: string, context?: Record<string, any>); } export default InvalidPasswordException;