"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSessionExpiredError = exports.MgError = void 0;
var tslib_1 = require("tslib");
/**
 * The base of any viewer-related error
 *
 * @export
 * @class MgError
 * @extends {Error}
 */
var MgError = /** @class */ (function (_super) {
    tslib_1.__extends(MgError, _super);
    function MgError(message) {
        var _this = _super.call(this, message) || this;
        _this.message = message;
        _this.name = "MgError";
        _this.message = message;
        _this.stack = new Error().stack;
        return _this;
    }
    return MgError;
}(Error));
exports.MgError = MgError;
/**
 * Indicates if this error is a session expired error
 *
 * @export
 * @param {MgError} err
 * @returns {boolean}
 */
function isSessionExpiredError(err) {
    return err.message.indexOf("MgSessionExpiredException") >= 0;
}
exports.isSessionExpiredError = isSessionExpiredError;
//# sourceMappingURL=error.js.map