Class APIError

If the API throws an error, it should always be an APIError!

Constructors

  • Parameters

    • message: string
    • server: string
    • method: string
    • endpoint: string
    • parameters: object
    • Optionalstatus_code: number
    • Optionaloriginal_error: Error

    Returns APIError

Properties

endpoint: string

The type of resource that was requested from the server

message: string

The reason why things didn't go as expected

method: string

The method used for this request (like "get", "post", etc...)

original_error?: Error

The error that caused the api to throw an APIError in the first place, if there is one

parameters: object

The filters that were used to specify what resource was wanted

server: string

The server to which the request was sent

status_code?: number

The status code that was returned by the server, if there is one