import { JoseCryptoSubtleErrorMap } from './TYPES'; /** * Error class whose instance is thrown in case of any error. * * @class * @typedef {JoseCryptoSubtleError} * @extends {Error} */ export default class JoseCryptoSubtleError extends Error { /** * Flag to identify if error is a custom error. */ readonly _isCustomError = true; /** * Flag to identoify if error is a JoseCryptoSubtleError. */ readonly _isJoseCryptoError = true; /** * Error's message string. */ message: string; /** * HTTP status code associated with the error. */ statusCode: number; /** * Error Code. */ errorCode: string; /** * Error object. */ error?: any; /** * Creates an instance of JoseCryptoSubtleError. * * @constructor * @param [e] DOMException instance to wrap with JoseCryptoSubtleError. * @param [eMap] JoseCryptoSubtleErrorMap to rewrap error for better understanding. */ constructor(e?: DOMException, eMap?: JoseCryptoSubtleErrorMap); }