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 No Content exception (HTTP 204) * @author dr. Salmi <reevosolutions@gmail.com> * @since 21-10-2023 11:38:33 */ /** * Exception thrown when the request is valid but the server has nothing to send back. * Corresponds to HTTP 204 No Content status code. * Used when an event is received and the service has nothing to do with it. * * @class NoContentException * @extends {BaseException} * @example * ```typescript * throw new NoContentException('No data to return'); * throw new NoContentException('Event processed but no response needed', { eventType: 'ping' }); * ``` */ declare class NoContentException extends BaseException { /** * Creates an instance of NoContentException. * * @param {string} [message='No Content'] - The error message * @param {Record<string, any>} [context] - Additional context about why there's no content * @memberof NoContentException */ constructor(message?: string, context?: Record<string, any>); } export default NoContentException;