Skip to content

PlatformExceptions

@tsed/platform-exceptions

Usage

typescript
import { PlatformExceptions } from "@tsed/platform-exceptions";

See /packages/platform/platform-exceptions/src/types/services/PlatformExceptions.ts.

Overview

ts
class PlatformExceptions {
    types: Map<ExceptionFilterKey, TokenProvider>;
    constructor();
    catch(error: unknown, ctx: DIContext): any;
    resourceNotFound(ctx: DIContext): any;
    protected resolve(error: any, ctx: DIContext): any;
}

Description

Catch all errors and return the json error with the right status code when it's possible.

types

ts
types: Map<ExceptionFilterKey, TokenProvider>;

catch

ts
catch(error: unknown, ctx: DIContext): any;

resourceNotFound

ts
resourceNotFound(ctx: DIContext): any;

protected resolve

ts
protected resolve(error: any, ctx: DIContext): any;

Released under the MIT License.