@yext/search-core
Version:
Typescript Networking Library for the Yext Search API
26 lines • 868 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchError = void 0;
/**
* Represents an error
*
* @remarks
* If the error originates from the Search API, the code and type property will be present.
*
* @public
*/
class SearchError extends Error {
/** @internal */
constructor(message, code, type) {
super(message);
this.message = message;
this.code = code;
this.type = type;
// When targeting ES5, it is necessary to manually set the prototype for instance of checks to work
// See: "Extending built-ins like Error, Array, and Map may no longer work"
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes
Object.setPrototypeOf(this, SearchError.prototype);
}
}
exports.SearchError = SearchError;
//# sourceMappingURL=SearchError.js.map