@opra/nestjs-http
Version:
Opra NestJS Http Module
22 lines (21 loc) • 825 B
TypeScript
import { type ArgumentsHost } from '@nestjs/common';
import { BaseExceptionFilter, ModuleRef } from '@nestjs/core';
/**
* OpraExceptionFilter
*
* NestJS exception filter that catches errors during OPRA HTTP requests
* and returns responses according to OPRA standards.
*/
export declare class OpraExceptionFilter extends BaseExceptionFilter {
private moduleRef;
constructor(moduleRef: ModuleRef);
/**
* Processes the caught exception.
* If the request has an OPRA context, it responds by converting the error to the OPRA error format.
* Otherwise, it uses the default NestJS exception handling mechanism.
*
* @param exception - The caught exception object.
* @param host - The arguments host.
*/
catch(exception: any, host: ArgumentsHost): Promise<void> | undefined;
}