A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html below:

Error | API Reference | ArcGIS Maps SDK for JavaScript 4.33

ESM: import Error from "@arcgis/core/core/Error.js";

CDN: const Error = await $arcgis.import("@arcgis/core/core/Error.js");

Class: @arcgis/core/core/Error

Since: ArcGIS Maps SDK 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);
  });
});
Constructors
Error Constructor new Error(name, message, details)

Parameters

A unique error name.

A message describing the details of the error.

optional

The details object provides additional details specific to the error.

Property Overview Name Type Summary Class details Object|null|undefined

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

Error message String

A message describing the details of the error.

Error name String

A unique error name.

Error Property Details

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);
});
message Property message String

A message describing the details of the error.

Example

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

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);
});

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4