UNPKG

@ticatec/express-exception

Version:

A comprehensive set of reusable error classes and middleware for Node.js Express applications with standardized error handling and consistent response formats.

24 lines (23 loc) 1.03 kB
/** * @fileoverview Express exception handling library that provides standardized error types and error handling middleware. * This library offers a comprehensive solution for handling various types of application errors in Express.js applications. */ import { AppError, UnauthenticatedError, InsufficientPermissionError, IllegalParameterError, ActionNotFoundError } from './Errors'; import { handleError } from "./handleError"; /** * Re-exports all error classes and the main error handling function. * This allows consumers to import everything they need from a single entry point. */ export { /** Generic application error with custom error codes */ AppError, /** Error for unauthenticated access attempts */ UnauthenticatedError, /** Error for insufficient permission scenarios */ InsufficientPermissionError, /** Error for invalid or illegal parameters */ IllegalParameterError, /** Error for non-existent routes or actions */ ActionNotFoundError, /** Main error handling middleware function */ handleError };