ExternalError

ExternalError

The ExternalError class represents errors reported by third-party service providers the code makes use of. This includes, but is not limited to, Azure Cosmos database, the SMS provider, the Wallet API and the MVC API.

An ExternalError is always reported with a status code of Codes.FailedDependency, i.e. 424.

Constructor

new ExternalError(message, serviceProvider, help)

Initialises an ExternalError with a custom error message, the name of the service provider or API from where the error originated and an optional debugging help text.

Parameters:
Name Type Description
message string

The error message

serviceProvider string

Name of the service provider or API throwing the error

help string

Debugging information

Source:

Members

code

The error code

Properties:
Name Type Description
code
Source:

Methods

Export() → {any}

Sanitises a ExternalError object by getting rid of the code property. Sending the code property client-side could make the impression that client shouldn't pay attention to the HTTP response's status header and should code against the response body's code property instead. That would be a bad design choice.

Source:
Returns:

A ExternalError object without the code.

Type
any