Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ErrorHandler

Handles erroneous HTTP status codes. You might, for example, use this to display a custom 404 page.

Hierarchy

Index

Methods

exec

  • exec(func: function): void
  • Sets an executor on this handler for the specified HTTP status codes or code ranges. If no specific codes or code ranges are specified, this handler will handle all status codes.

    Parameters

    Returns void

forCode

  • Sets specific HTTP status codes to run this handler for.

    Parameters

    • Rest ...code: number[]

      The HTTP status codes to handle.

    Returns ErrorHandler

    This ErrorHandler, for the sake of chaining.

forCodes

  • forCodes(startIncl: number, endExcl: number): ErrorHandler
  • Sets a range of HTTP status codes to run this handler for.

    Parameters

    • startIncl: number

      The beginning of the range, inclusive.

    • endExcl: number

      The end of the range, exclusive.

    Returns ErrorHandler

    This ErrorHandler, for the sake of chaining.

Generated using TypeDoc