msal
Version:
Microsoft Authentication Library for js
40 lines • 1.51 kB
JavaScript
;
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.AuthErrorMessage = {
unexpectedError: {
code: "unexpected_error",
desc: "Unexpected error in authentication."
},
noWindowObjectError: {
code: "no_window_object",
desc: "No window object available. Details:"
}
};
/**
* General error class thrown by the MSAL.js library.
*/
var AuthError = /** @class */ (function (_super) {
tslib_1.__extends(AuthError, _super);
function AuthError(errorCode, errorMessage) {
var _this = _super.call(this, errorMessage) || this;
Object.setPrototypeOf(_this, AuthError.prototype);
_this.errorCode = errorCode;
_this.errorMessage = errorMessage;
_this.name = "AuthError";
return _this;
}
AuthError.createUnexpectedError = function (errDesc) {
return new AuthError(exports.AuthErrorMessage.unexpectedError.code, exports.AuthErrorMessage.unexpectedError.desc + ": " + errDesc);
};
AuthError.createNoWindowObjectError = function (errDesc) {
return new AuthError(exports.AuthErrorMessage.noWindowObjectError.code, exports.AuthErrorMessage.noWindowObjectError.desc + " " + errDesc);
};
return AuthError;
}(Error));
exports.AuthError = AuthError;
//# sourceMappingURL=AuthError.js.map