botbook/node_modules/@azure/msal-common/dist/error/CacheError.mjs
Rodrigo Rodriguez 6ae15fe3e5 Updated.
2024-09-04 13:13:15 -03:00

33 lines
1.2 KiB
JavaScript

/*! @azure/msal-common v14.14.2 2024-08-28 */
'use strict';
import { cacheUnknownErrorCode, cacheQuotaExceededErrorCode } from './CacheErrorCodes.mjs';
import * as CacheErrorCodes from './CacheErrorCodes.mjs';
export { CacheErrorCodes };
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const CacheErrorMessages = {
[cacheQuotaExceededErrorCode]: "Exceeded cache storage capacity.",
[cacheUnknownErrorCode]: "Unexpected error occurred when using cache storage.",
};
/**
* Error thrown when there is an error with the cache
*/
class CacheError extends Error {
constructor(errorCode, errorMessage) {
const message = errorMessage ||
(CacheErrorMessages[errorCode]
? CacheErrorMessages[errorCode]
: CacheErrorMessages[cacheUnknownErrorCode]);
super(`${errorCode}: ${message}`);
Object.setPrototypeOf(this, CacheError.prototype);
this.name = "CacheError";
this.errorCode = errorCode;
this.errorMessage = message;
}
}
export { CacheError, CacheErrorMessages };
//# sourceMappingURL=CacheError.mjs.map