45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
/**
|
|
* Error Handling Module
|
|
*
|
|
* Standardized error handling for all ERP-Suite backends.
|
|
* Provides base error classes, HTTP-specific errors, and
|
|
* middleware/filters for NestJS and Express.
|
|
*
|
|
* @module @erp-suite/core/errors
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* // Using in NestJS
|
|
* import { GlobalExceptionFilter, NotFoundError } from '@erp-suite/core';
|
|
*
|
|
* // Using in Express
|
|
* import { createErrorMiddleware, BadRequestError } from '@erp-suite/core';
|
|
* ```
|
|
*/
|
|
|
|
// Base error types
|
|
export { BaseError, ErrorResponse } from './base-error';
|
|
|
|
// HTTP error classes
|
|
export {
|
|
BadRequestError,
|
|
UnauthorizedError,
|
|
ForbiddenError,
|
|
NotFoundError,
|
|
ConflictError,
|
|
ValidationError,
|
|
InternalServerError,
|
|
} from './http-errors';
|
|
|
|
// NestJS exception filter
|
|
export { GlobalExceptionFilter } from './error-filter';
|
|
|
|
// Express middleware
|
|
export {
|
|
createErrorMiddleware,
|
|
errorMiddleware,
|
|
notFoundMiddleware,
|
|
ErrorLogger,
|
|
ErrorMiddlewareOptions,
|
|
} from './error-middleware';
|