The provider's union of error codes.
The provider's union of error codes.
OptionalstatusCode: numberOptionaldetails: unknownReadonlycodeNormalized error code. Each provider defines its own union.
Optional ReadonlydetailsThe raw error body or other context, if any.
Optional ReadonlystatusHTTP status of the response that caused the error, if any.
Static[hasMakes value instanceof PaymentsError true for an error from any copy of
this package, not only this one. It looks for a brand that every copy puts
on PaymentsError.prototype, so the prototype itself is not counted as an
instance. On a subclass, such as SquareError, it is the usual
prototype-chain check.
It returns a plain boolean rather than a type predicate, so TypeScript
keeps narrowing instanceof SquareError to SquareError.
Base class for the errors each provider package throws (
SquareError,StripeError,CloverError). It carries a provider-specificcode, plus the HTTP status and raw details when the error came from an API response.Catch it to handle any provider's error in one place.
instanceof PaymentsErrormatches an error from any copy of this package, so it still works when providers built on different core versions install separate copies. Checks against a subclass (instanceof SquareError) are ordinary prototype checks.Example