Documentation
    Preparing search index...

    Namespace ExceptionManager

    Exception manager for HTTP server.

    ExceptionManager is an utility class who can insert or erase custom error class with its conversion method to a regular nest.HttpException instance.

    If you define an API function through TypedRoute or EncryptedRoute instead of the basic router decorator functions like nest.Get or nest.Post and the API function throws a custom error whose class has been inserted in this ExceptionManager, the error would be automatically converted to the regular nest.HttpException instance by the ExceptionManager.Closure function.

    Therefore, with this ExceptionManager and TypedRoute or EncryptedRoute, you can manage your custom error classes much systematically. You can avoid 500 internal server error or hard coding implementation about the custom error classes.

    Below error class is configured in this ExceptionManager by default.

    • @nestia/fetcher.HttpError

    Jeongho Nam - https://github.com/samchon

    contracts/common.md#principled-implementation Converters are kept as an ordered list of class and closure, and an error is converted by the first class it is an instance of; the insertion keeps every subclass before its superclasses so the most specific converter wins, and HttpError from the fetcher is registered by default.

    contracts/common.md#clear-and-simple-design One namespace with the two collections and four operations; the listener set and the tuple list are the only state.

    contracts/common.md#prohibited-implementation-shortcuts The registration is public and explicit; no error class is special-cased except the default HttpError conversion.

    contracts/common.md#meaningful-documentation The comment documents the converter and listener concepts with an example.

    contracts/portability.md#os-neutral-implementation Converter ordering and listener registration operate on JavaScript class and function identity, not native path or process identity.

    Closure
    erase
    insert
    off
    on