Represents an error caused by an api call i.e. it has attributes for a HTTP status code and the returned body object.

Example API returns a ErrorMessageObject whenever HTTP status code is not in [200, 299] => ApiException(404, someErrorMessageObject)

Type Parameters

  • T

Hierarchy

  • Error
    • ApiException

Constructors

Properties

body: T
code: number
headers: {
    [key: string]: string;
}
message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: Object
    • OptionalconstructorOpt: Function

    Returns void