Documentation
    Preparing search index...

    The base HTTP exception handler one can inherit from to handle HTTP exceptions.

    The HTTP exception handler has support for

    • Ability to render exceptions by calling the render method on the exception.
    • Rendering status pages
    • Pretty printing errors during development
    • Transforming errors to JSON or HTML using content negotiation
    • Reporting errors

    Hierarchy

    • default
      • ExceptionHandler
    Index

    Constructors

    Methods

    • Renders validation error messages as a JSON response Returns errors in a simple format with field-specific messages

      Parameters

      • error: HttpError

        Validation error containing messages array

      • ctx: HttpContext

        HTTP context for the request

      Returns Promise<void>

    • Renders validation error messages as JSON API compliant response Transforms validation messages to JSON API error object format

      Parameters

      • error: HttpError

        Validation error containing messages array

      • ctx: HttpContext

        HTTP context for the request

      Returns Promise<void>

    • Renders validation error messages as an HTML response Creates simple HTML list of field errors separated by line breaks

      Parameters

      • error: HttpError

        Validation error containing messages array

      • ctx: HttpContext

        HTTP context for the request

      Returns Promise<void>

    • Renders an error to the appropriate response format based on content negotiation Supports HTML, JSON API, and JSON formats based on Accept headers

      Parameters

      Returns Promise<any>

    • Renders validation errors to the appropriate response format based on content negotiation Supports HTML, JSON API, and JSON formats for validation error messages

      Parameters

      Returns Promise<void>

    • Reports an error to logging systems if reporting is enabled Allows errors to self-report via their own report method if available

      Parameters

      • error: unknown

        Any error object to report

      • ctx: HttpContext

        HTTP context for additional reporting context

      Returns Promise<void>

    • Handles errors during HTTP request processing Delegates to error's own handle method if available, otherwise renders response

      Parameters

      • error: unknown

        Any error object to handle

      • ctx: HttpContext

        HTTP context for error handling

      Returns Promise<any>