Skip to content

Class: ODataExceptionFilter

Defined in: packages/core/src/response/odata-exception.filter.ts:37

NestJS exception filter that converts all caught exceptions into OData v4 error format.

Per D-09: all errors are formatted as { error: { code, message, details } }. Per D-11, T-03-08: never includes stack traces or internal server details.

Handled exception types:

  • ODataParseError -> HTTP 400, code 'BadRequest', user message
  • ODataValidationError -> HTTP 400, code 'BadRequest', user message
  • HttpException -> uses exception's HTTP status code, generic OData code
  • All others -> HTTP 500, code 'InternalServerError', generic message (no details leaked)

Zero TypeORM imports — per PKG-01 architecture constraint.

Implements

  • ExceptionFilter

Constructors

Constructor

new ODataExceptionFilter(): ODataExceptionFilter

Returns

ODataExceptionFilter

Methods

catch()

catch(exception, host): void

Defined in: packages/core/src/response/odata-exception.filter.ts:38

Method to implement a custom exception filter.

Parameters

exception

unknown

the class of the exception being handled

host

ArgumentsHost

used to access an array of arguments for the in-flight request

Returns

void

Implementation of

ExceptionFilter.catch