Setu-TS
    Preparing search index...

    Interface IErrorResponder

    A request-scoped error responder: writes an error response in the application's configured format.

    Implemented by @setu-ts/exceptions from the formatter and content type its errorHandler resolved at factory time. The interface — not a formatter reference — is what common carries, because a package without exceptions cannot construct the HttpError a formatter needs: a plain Error carries no statusCode, so a formatter would answer 500 for a tenant 400 and maskInternalErrors would then mask it.

    0.1.0

    interface IErrorResponder {
        respond(target: ErrorResponderTarget, init: ErrorResponseInit): void;
        statusFor?(error: unknown): number;
    }
    Index
    • Purely predicts the status the owner serves for a thrown value. A custom response hook may serve a different status. Must perform no reporting.

      Parameters

      • error: unknown

        The thrown value

      Returns number

      The serveable response status

      0.10.0