Skip to content

PesepayError

The shape of result.error. An interface, not a class — the class ships in the CDN runtime. Narrow on code, not instanceof.

export interface PesepayError extends Error
NameTypeDescription
codePesepayErrorCodeThe specific reason. Branch on this.
declineCode?stringRaw refusal reason from the processor, when one was given.
param?PesepayErrorParamThe option or field the error is about, when there is one.
requestId?stringCorrelates a failure with Pesepay’s logs, from a Pesepay-Request-Id header when the response carried one.
statusCode?numberHTTP status, when the failure came from a response.
typePesepayErrorTypeThe broad category, such as card_error or network_error.