@dasch-swiss/dsp-js
Version:
TypeScript client library for DSP-API
23 lines • 688 B
JavaScript
/**
* Generic error class for API responses where the format was incorrect.
*
* @category Response
*/
export class DataError extends Error {
/**
* Constructor.
*/
constructor(message, response) {
super(message);
this.response = response;
// Check if the browser allows setting prototype, otherwise manually set it
// We need to set the prototype to make sure "instanceof DataError" checks are working
if (Object.setPrototypeOf) {
Object.setPrototypeOf(this, DataError.prototype);
}
else {
this['__proto__'] = DataError.prototype;
}
}
}
//# sourceMappingURL=data-error.js.map