Represents an HTTP error that extends the standard Error object. Includes optional status code properties for HTTP response handling.

HttpError

interface HttpError {
    cause?: unknown;
    message: string;
    name: string;
    stack?: string;
    status?: StatusCodes;
    statusCode?: StatusCodes;
}

Hierarchy

  • Error
    • HttpError

Properties

cause?: unknown
message: string
name: string
stack?: string
status?: StatusCodes

Alternative property for HTTP status code

statusCode?: StatusCodes

The HTTP status code for the error response