UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

32 lines (31 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BitmovinError = void 0; const models_1 = require("../models"); const Mapper_1 = require("./Mapper"); class BitmovinError extends Error { constructor(message, httpStatusCode, shortMessage, developerMessage, requestId, errorCode, details, links) { super(message); this.name = 'BitmovinError'; this.shortMessage = shortMessage; this.httpStatusCode = httpStatusCode; this.developerMessage = developerMessage; this.requestId = requestId; this.errorCode = errorCode; this.details = (0, Mapper_1.mapArray)(details, models_1.Message); this.links = (0, Mapper_1.mapArray)(links, models_1.Link); // Maintain stack trace if possible if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, BitmovinError); } // Fix prototype chain if possible if (typeof Object.setPrototypeOf === 'function') { Object.setPrototypeOf(this, new.target.prototype); return; } // Fallback to fix prototype chain if possible this.__proto__ = new.target.prototype; } } exports.BitmovinError = BitmovinError; exports.default = BitmovinError;