Skip to content

BrexError

Defined in: src/core/error.ts:2

Error thrown for any non-2xx Brex API response.

  • Error

new BrexError(args): BrexError

Defined in: src/core/error.ts:14

unknown

Headers

string

number

string

BrexError

Error.constructor

readonly body: unknown

Defined in: src/core/error.ts:8

Parsed JSON error body when the response was JSON, otherwise the raw text.


optional cause?: unknown

Defined in: docs/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause


readonly headers: Headers

Defined in: src/core/error.ts:10

Full response headers, as an escape hatch.


message: string

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message


readonly method: string

Defined in: src/core/error.ts:11


name: string

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name


readonly requestId: string | undefined

Defined in: src/core/error.ts:6

Brex request id (from the x-request-id response header), if present.


optional stack?: string

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack


readonly status: number

Defined in: src/core/error.ts:4

HTTP status code.


readonly url: string

Defined in: src/core/error.ts:12