The error class thrown by any of the utility classes.

Hierarchy

  • Error
    • CommercetoolsError

Constructors

Properties

cause?: unknown
data?: any

The data passed in to the error class. This could be anything, but is most likely to be the response from a commercetools request.

isCommercetoolsError: true = true

Convenience mechanism for identifying that the error that's just been caught is a CommercetoolsError.

message: string
name: string
stack?: string
status: undefined | number

If available, this is the status code of the request received back from commercetools: https://docs.commercetools.com/api/errors

prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

  • Parse the JSON string back in to an object for easier viewing

    Parameters

    • config: undefined | InternalAxiosRequestConfig<any>

    Returns any