@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 1.84 kB
Source Map (JSON)
{"version":3,"file":"AmplifyError.mjs","sources":["../../../src/errors/AmplifyError.ts"],"sourcesContent":["export class AmplifyError extends Error {\n /**\n * Constructs an AmplifyError.\n *\n * @param message text that describes the main problem.\n * @param underlyingError the underlying cause of the error.\n * @param recoverySuggestion suggestion to recover from the error.\n *\n */\n constructor({ message, name, recoverySuggestion, underlyingError, metadata, }) {\n super(message);\n this.name = name;\n this.underlyingError = underlyingError;\n this.recoverySuggestion = recoverySuggestion;\n if (metadata) {\n // If metadata exists, explicitly only record the following properties.\n const { extendedRequestId, httpStatusCode, requestId } = metadata;\n this.metadata = { extendedRequestId, httpStatusCode, requestId };\n }\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = AmplifyError;\n Object.setPrototypeOf(this, AmplifyError.prototype);\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,YAAY,SAAS,KAAK,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,EAAE,QAAQ,GAAG,EAAE;AACnF,QAAQ,KAAK,CAAC,OAAO,CAAC;AACtB,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB,QAAQ,IAAI,CAAC,eAAe,GAAG,eAAe;AAC9C,QAAQ,IAAI,CAAC,kBAAkB,GAAG,kBAAkB;AACpD,QAAQ,IAAI,QAAQ,EAAE;AACtB;AACA,YAAY,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,QAAQ;AAC7E,YAAY,IAAI,CAAC,QAAQ,GAAG,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE;AAC5E;AACA;AACA;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,YAAY;AACvC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;AAC3D;AACA;;;;"}