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.09 kB
import BaseException from "./base.exception"; /** * @fileoverview Service Unavailable exception (HTTP 503) * @author dr. Salmi <reevosolutions@gmail.com> */ /** * Exception thrown when a service is temporarily unavailable. * Corresponds to HTTP 503 Service Unavailable status code. * * @class ServiceUnavailableException * @extends {BaseException} * @example * ```typescript * throw new ServiceUnavailableException('Database temporarily unavailable'); * throw new ServiceUnavailableException('Service under maintenance', { * estimatedDowntime: '2 hours', * retryAfter: 7200 * }); * ``` */ declare class ServiceUnavailableException extends BaseException { /** * Creates an instance of ServiceUnavailableException. * * @param {string} [message='Service Unavailable'] - The error message * @param {Record<string, any>} [context] - Additional context about the service unavailability * @memberof ServiceUnavailableException */ constructor(message?: string, context?: Record<string, any>); } export default ServiceUnavailableException;