@signiant/media-shuttle-sdk-base
Version:
The base parent sdk behind other media shuttle sdks (e.g. media-shuttle-sdk)
42 lines (41 loc) • 1.9 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
/**
* TODO Investigate providing types for existing Signiant http-errors library.
*/
var HttpError = /** @class */ (function (_super) {
__extends(HttpError, _super);
/**
* A standard error http error base class.
* To be extend by specific error types.
*
* @param {number} statusCode the HTTP status code for this error
* @param {string} message a locale-specific human-readable error message (typically just English)
* @param {string} errorCode a machine-readable error code. Typically an english-based string of the
* format word1.word2.word3 . For example: item.not.found
* This error code would typically unique and un-changing for an error of a given type, regardless
* of whether the related human-readable message has changed.
* It is possible the errorCode could not be defined.
*/
function HttpError(message, statusCode, errorCode) {
var _this = _super.call(this, message) || this;
_this.statusCode = statusCode;
_this.errorCode = errorCode;
return _this;
}
return HttpError;
}(Error));
export default HttpError;