Interface HttpErrorClass<TCode>

Interface describing what an HttpError class should look like. This helps us make sure all HttpError classes have the same utility static functions.

interface HttpErrorClass<TCode> {
    new HttpErrorClassnew (message?: string, options?: HttpErrorOptions): HttpError<TCode>;
    isInstance: ((error: unknown) => error is HttpError<TCode>);
    statusCode: TCode;
    uri: NamedNode<string>;
}

Type Parameters

  • TCode extends number = number

Constructors

Properties

Constructors

Properties

isInstance: ((error: unknown) => error is HttpError<TCode>)

Checks whether the given error is an instance of this class.

statusCode: TCode

The status code corresponding to this error class.

uri: NamedNode<string>

A unique URI identifying this error class.