Object: esri/core/Error
Since: ArcGIS API for JavaScript 4.5

Error is a class that enhances the debugging and error handling process. Rather than returning a generic JavaScript error, this Error returns a standardized error object with several properties. The error class can be useful in many scenarios, such as working with promises, the esriRequest module, and many different layers and widgets.

See also:
Example:
button.on("click", function() {
  esriRequest(url, options).then(function(response) {
    // do something useful
  }).catch(function(error){
    console.log("informative error message: ", error.message);
  });
});

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryObject
Object

The details object provides additional details specific to the error, giving more information about why the error was raised.

more details
more detailsError
String

A message describing the details of the error.

more details
more detailsError
String

A unique error name.

more details
more detailsError

Property Details

detailsObject

The details object provides additional details specific to the error, giving more information about why the error was raised. For example, the details object for esriRequest includes additional information to help the developer diagnose issues with a problematic request.

Example:
someAsyncFunction.then(callback)
  .catch(function(error){
    console.log("Error details: ", error.details);
});
messageString

A message describing the details of the error.

Example:
someAsyncFunction.then(callback)
  .catch(function(error){
    console.log("Error message: ", error.message);
});
nameString

A unique error name. This can be used to map to a localized error message to present to the user.

Example:
someAsyncFunction.then(callback)
  .catch(function(error){
    console.log("Error name: ", error.name);
});

API Reference search results

NameTypeModule
Loading...