import type Error from "../../../core/Error.js";

/** The elevation profile error name. */
export type ElevationProfileErrorName = "too-complex" | "elevation-query-error" | "unknown";

/**
 * ElevationProfileError is an error class for reporting errors in
 * [ElevationProfileAnalysisView2D#results](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#results) or
 * [ElevationProfileAnalysisView3D#results](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html#results).
 *
 * The following error names are defined:
 *
 * - "too-complex": The input geometry has too many points.
 * - "elevation-query-error": An error occurred while querying the elevation data.
 * - "unknown": An unknown error occurred.
 *
 * @since 4.34
 * @see [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html)
 * @see [ElevationProfileAnalysisView2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html)
 * @see [ElevationProfileAnalysisView3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html)
 */
export default class ElevationProfileError<T = any> extends Error {
  constructor(name: ElevationProfileErrorName, message: string, details?: T);
  /**
   * The name of the elevation profile error.
   *
   * @default "unknown"
   * @example
   * someAsyncFunction.then(callback)
   *   .catch(function(error){
   *     console.log("Error name: ", error.name);
   * });
   */
  readonly name: ElevationProfileErrorName;
}