BrexError
Defined in: src/core/error.ts:2
Error thrown for any non-2xx Brex API response.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BrexError(
args):BrexError
Defined in: src/core/error.ts:14
Parameters
Section titled “Parameters”unknown
headers
Section titled “headers”Headers
method
Section titled “method”string
status
Section titled “status”number
string
Returns
Section titled “Returns”BrexError
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlybody:unknown
Defined in: src/core/error.ts:8
Parsed JSON error body when the response was JSON, otherwise the raw text.
cause?
Section titled “cause?”
optionalcause?:unknown
Defined in: docs/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
headers
Section titled “headers”
readonlyheaders:Headers
Defined in: src/core/error.ts:10
Full response headers, as an escape hatch.
message
Section titled “message”message:
string
Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.message
method
Section titled “method”
readonlymethod:string
Defined in: src/core/error.ts:11
name:
string
Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
requestId
Section titled “requestId”
readonlyrequestId:string|undefined
Defined in: src/core/error.ts:6
Brex request id (from the x-request-id response header), if present.
stack?
Section titled “stack?”
optionalstack?:string
Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
status
Section titled “status”
readonlystatus:number
Defined in: src/core/error.ts:4
HTTP status code.
readonlyurl:string
Defined in: src/core/error.ts:12