@vsokolov/utils - v0.32.0
    Preparing search index...

    Interface TryCatchOptions<E>

    interface TryCatchOptions<E extends Error = ErrorWithStatus> {
        defaultStatus?: number;
        ErrorClass?: ErrorConstructor<E>;
    }

    Type Parameters

    Index

    Properties

    defaultStatus?: number

    Default HTTP status code to use when caught error has no status property.

    500
    
    ErrorClass?: ErrorConstructor<E>

    Custom error class constructor for transforming caught errors. If provided, all caught errors will be converted to instances of this class.

    Error