Skip to content

BkperError

Standard error class for Bkper API errors. Extends Error to enable instanceof checks and standard error handling.

Extends

  • Error

Constructors

Constructor

new BkperError(
code,
message,
reason?): BkperError;

Parameters

ParameterType
codenumber
messagestring
reason?string

Returns

BkperError

Overrides

Error.constructor

Properties

code

readonly code: number;

HTTP status code (e.g., 404, 400, 500)


message

message: string;

Inherited from

Error.message

name

name: string;

Inherited from

Error.name

reason?

readonly optional reason: string;

Machine-readable reason (e.g., “notFound”, “badRequest”)


stack?

optional stack: string;

Inherited from

Error.stack

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any;

Optional override for formatting stack traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace

stackTraceLimit

static stackTraceLimit: number;

Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void;

Create .stack property on a target object

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace