閱讀英文版本

分享方式:


HttpError class

Error thrown when an HTTP request fails.

Extends

Error

Constructors

HttpError(string, number)

Constructs a new instance of HttpError.

Properties

Error
message
name
stack
statusCode

The HTTP status code represented by this error.

Constructor Details

HttpError(string, number)

Constructs a new instance of HttpError.

TypeScript
new HttpError(errorMessage: string, statusCode: number)

Parameters

errorMessage

string

A descriptive error message.

statusCode

number

The HTTP status code represented by this error.

Property Details

Error

TypeScript
static Error: ErrorConstructor

Property Value

ErrorConstructor

message

TypeScript
message: string

Property Value

string

name

TypeScript
name: string

Property Value

string

stack

TypeScript
stack?: string

Property Value

string

statusCode

The HTTP status code represented by this error.

TypeScript
public statusCode: number

Property Value

number