UNPKG

1.57 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright (c) Microsoft Corporation. All rights reserved.
4 * Licensed under the MIT License.
5 */
6Object.defineProperty(exports, "__esModule", { value: true });
7exports.AuthError = exports.AuthErrorMessage = void 0;
8var tslib_1 = require("tslib");
9exports.AuthErrorMessage = {
10 unexpectedError: {
11 code: "unexpected_error",
12 desc: "Unexpected error in authentication."
13 },
14 noWindowObjectError: {
15 code: "no_window_object",
16 desc: "No window object available. Details:"
17 }
18};
19/**
20 * General error class thrown by the MSAL.js library.
21 */
22var AuthError = /** @class */ (function (_super) {
23 tslib_1.__extends(AuthError, _super);
24 function AuthError(errorCode, errorMessage) {
25 var _this = _super.call(this, errorMessage) || this;
26 Object.setPrototypeOf(_this, AuthError.prototype);
27 _this.errorCode = errorCode;
28 _this.errorMessage = errorMessage;
29 _this.name = "AuthError";
30 return _this;
31 }
32 AuthError.createUnexpectedError = function (errDesc) {
33 return new AuthError(exports.AuthErrorMessage.unexpectedError.code, exports.AuthErrorMessage.unexpectedError.desc + ": " + errDesc);
34 };
35 AuthError.createNoWindowObjectError = function (errDesc) {
36 return new AuthError(exports.AuthErrorMessage.noWindowObjectError.code, exports.AuthErrorMessage.noWindowObjectError.desc + " " + errDesc);
37 };
38 return AuthError;
39}(Error));
40exports.AuthError = AuthError;
41//# sourceMappingURL=AuthError.js.map
\No newline at end of file