Skip to content

API Reference


API Reference / ApiResponseError

Class: ApiResponseError ​

Defined in: src/errors/ApiResponseError.ts:27

Extends ​

Constructors ​

Constructor ​

new ApiResponseError(message, status, details?, cause?): ApiResponseError

Defined in: src/errors/ApiResponseError.ts:35

Parameters ​

message ​

string

status ​

number

details? ​

unknown

cause? ​

unknown

Returns ​

ApiResponseError

Overrides ​

DhanError.constructor

Properties ​

errorCode? ​

readonly optional errorCode?: string

Defined in: src/errors/ApiResponseError.ts:29

Dhan's own error code from the response body, e.g. "DH-906" — see TradingErrorCode.


errorType? ​

readonly optional errorType?: string

Defined in: src/errors/ApiResponseError.ts:31

Dhan's own error category from the response body, e.g. "Order_Error".


errorMessage? ​

readonly optional errorMessage?: string

Defined in: src/errors/ApiResponseError.ts:33

Dhan's own human-readable message from the response body, when present.


code ​

readonly code: string

Defined in: src/errors/DhanError.ts:2

Inherited from ​

DhanError.code


status? ​

readonly optional status?: number

Defined in: src/errors/DhanError.ts:3

Inherited from ​

DhanError.status


details? ​

readonly optional details?: unknown

Defined in: src/errors/DhanError.ts:4

Inherited from ​

DhanError.details


cause? ​

readonly optional cause?: unknown

Defined in: src/errors/DhanError.ts:5

Inherited from ​

DhanError.cause

Community project — not affiliated with Dhan. MIT License.