@aws-amplify/platform-core
Advanced tools
Comparing version 0.5.0-beta.3 to 0.5.0-beta.4
@@ -56,13 +56,31 @@ "use strict"; | ||
cause, | ||
}); | ||
}, errorSerializer); | ||
} | ||
static fromStderr = (_stderr) => { | ||
const extractionRegex = /["']?serializedError["']?:[ ]?["'](.*)["']/; | ||
/** | ||
* `["']?serializedError["']?:[ ]?` captures the start of the serialized error. The quotes depend on which OS is being used | ||
* `(?:`(.+?)`|'(.+?)'|"((?:\\"|[^"])*?)")` captures the rest of the serialized string enclosed in either single quote, | ||
* double quotes or back-ticks. | ||
*/ | ||
const extractionRegex = /["']?serializedError["']?:[ ]?(?:`(.+?)`|'(.+?)'|"((?:\\"|[^"])*?)")/; | ||
const serialized = _stderr.match(extractionRegex); | ||
if (serialized && serialized.length == 2) { | ||
if (serialized && serialized.length === 4) { | ||
// 4 because 1 match and 3 capturing groups | ||
try { | ||
const { name, classification, options, cause } = JSON.parse(serialized[1]); | ||
const serializedString = serialized | ||
.slice(1) | ||
.find((item) => item && item.length > 0) | ||
?.replaceAll('\\"', '"') | ||
.replaceAll("\\'", "'"); | ||
if (!serializedString) { | ||
return undefined; | ||
} | ||
const { name, classification, options, cause } = JSON.parse(serializedString); | ||
let serializedCause = cause; | ||
if (cause && ErrorSerializerDeserializer.isSerializedErrorType(cause)) { | ||
serializedCause = ErrorSerializerDeserializer.deserialize(cause); | ||
} | ||
return classification === 'ERROR' | ||
? new _1.AmplifyUserError(name, options, cause) | ||
: new _1.AmplifyFault(name, options, cause); | ||
? new _1.AmplifyUserError(name, options, serializedCause) | ||
: new _1.AmplifyFault(name, options, serializedCause); | ||
} | ||
@@ -86,2 +104,27 @@ catch (error) { | ||
exports.AmplifyError = AmplifyError; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1wbGlmeV9lcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lcnJvcnMvYW1wb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5ldyBBbXBsaWZ5RmF1bHQoXG4gICAgICAnVW5rbm93bkZhdWx0JyxcbiAgICAgIHtcbiAgICAgICAgbWVzc2FnZTogZXJyb3JNZXNzYWdlLFxuICAgICAgfSxcbiAgICAgIGVycm9yIGluc3RhbmNlb2YgRXJyb3IgPyBlcnJvciA6IG5ldyBFcnJvcihTdHJpbmcoZXJyb3IpKVxuICAgICk7XG4gIH07XG59XG5cbi8qKlxuICogQW1wbGlmeSBleGNlcHRpb24gY2xhc3NpZmljYXRpb25zXG4gKi9cbmV4cG9ydCB0eXBlIEFtcGxpZnlFcnJvckNsYXNzaWZpY2F0aW9uID0gJ0ZBVUxUJyB8ICdFUlJPUic7XG5cbi8qKlxuICogQW1wbGlmeSBFcnJvciBvcHRpb25zIG9iamVjdFxuICovXG5leHBvcnQgdHlwZSBBbXBsaWZ5RXJyb3JPcHRpb25zID0ge1xuICBtZXNzYWdlOiBzdHJpbmc7XG4gIGRldGFpbHM/OiBzdHJpbmc7XG4gIHJlc29sdXRpb24/OiBzdHJpbmc7XG4gIGxpbms/OiBzdHJpbmc7XG5cbiAgLy8gQ2xvdWRGb3JtYXRpb24gb3IgTm9kZUpTIGVycm9yIGNvZGVzXG4gIGNvZGU/OiBzdHJpbmc7XG59O1xuXG4vKipcbiAqIFNhbWUgYXMgQW1wbGlmeUVycm9yT3B0aW9ucyBleGNlcHQgcmVzb2x1dGlvbiBpcyByZXF1aXJlZFxuICovXG5leHBvcnQgdHlwZSBBbXBsaWZ5VXNlckVycm9yT3B0aW9ucyA9IE9taXQ8XG4gIEFtcGxpZnlFcnJvck9wdGlvbnMsXG4gICdyZXNvbHV0aW9uJ1xuPiAmIHsgcmVzb2x1dGlvbjogc3RyaW5nIH07XG4iXX0= | ||
const errorSerializer = (_, value) => { | ||
if (value instanceof Error && value?.constructor.name === 'Error') { | ||
return ErrorSerializerDeserializer.serialize(value); | ||
} | ||
return value; | ||
}; | ||
class ErrorSerializerDeserializer { | ||
static serialize = (error) => { | ||
const serializedError = { | ||
name: 'Error', | ||
message: error.message, | ||
}; | ||
return serializedError; | ||
}; | ||
static deserialize = (deserialized) => { | ||
return new Error(deserialized.message); | ||
}; | ||
static isSerializedErrorType = (obj) => { | ||
if (obj && | ||
obj.name && | ||
obj.name === 'Error') | ||
return true; | ||
return false; | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1wbGlmeV9lcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lcnJvcnMvYW1wbGlmeV9lcnJvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx3QkFBbUQ7QUFFbkQ7O0dBRUc7QUFDSCxNQUFzQixZQUF3QyxTQUFRLEtBQUs7SUF1QnZEO0lBQ0E7SUFDQztJQUNEO0lBekJYLGVBQWUsQ0FBVTtJQUNoQixPQUFPLENBQVM7SUFDaEIsVUFBVSxDQUFVO0lBQ3BCLE9BQU8sQ0FBVTtJQUNqQixJQUFJLENBQVU7SUFDZCxJQUFJLENBQVU7SUFFOUI7Ozs7Ozs7Ozs7Ozs7T0FhRztJQUNILFlBQ2tCLElBQU8sRUFDUCxjQUEwQyxFQUN6QyxPQUE0QixFQUM3QixLQUFhO1FBRTdCLDZFQUE2RTtRQUM3RSw2RUFBNkU7UUFDN0UsS0FBSyxDQUFDLE9BQU8sQ0FBQyxPQUFPLEVBQUUsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO1FBUGxCLFNBQUksR0FBSixJQUFJLENBQUc7UUFDUCxtQkFBYyxHQUFkLGNBQWMsQ0FBNEI7UUFDekMsWUFBTyxHQUFQLE9BQU8sQ0FBcUI7UUFDN0IsVUFBSyxHQUFMLEtBQUssQ0FBUTtRQU03Qiw2SUFBNkk7UUFDN0ksTUFBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsWUFBWSxDQUFDLFNBQVMsQ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HZhbHVlKTtcbiAgfVxuICByZXR1cm4gdmFsdWU7XG59O1xuY2xhc3MgRXJyb3JTZXJpYWxpemVyRGVzZXJpYWxpemVyIHtcbiAgc3RhdGljIHNlcmlhbGl6ZSA9IChlcnJvcjogRXJyb3IpID0+IHtcbiAgICBjb25zdCBzZXJpYWxpemVkRXJyb3I6IFNlcmlhbGl6ZWRFcnJvclR5cGUgPSB7XG4gICAgICBuYW1lOiAnRXJyb3InLFxuICAgICAgbWVzc2FnZTogZXJyb3IubWVzc2FnZSxcbiAgICB9O1xuICAgIHJldHVybiBzZXJpYWxpemVkRXJyb3I7XG4gIH07XG5cbiAgc3RhdGljIGRlc2VyaWFsaXplID0gKGRlc2VyaWFsaXplZDogU2VyaWFsaXplZEVycm9yVHlwZSkgPT4ge1xuICAgIHJldHVybiBuZXcgRXJyb3IoZGVzZXJpYWxpemVkLm1lc3NhZ2UpO1xuICB9O1xuXG4gIHN0YXRpYyBpc1NlcmlhbGl6ZWRFcnJvclR5cGUgPSAob2JqOiB1bmtub3duKTogb2JqIGlzIFNlcmlhbGl6ZWRFcnJvclR5cGUgPT4ge1xuICAgIGlmIChcbiAgICAgIG9iaiAmJlxuICAgICAgKG9iaiBhcyBTZXJpYWxpemVkRXJyb3JUeXBlKS5uYW1lICYmXG4gICAgICAob2JqIGFzIFNlcmlhbGl6ZWRFcnJvclR5cGUpLm5hbWUgPT09ICdFcnJvcidcbiAgICApXG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG50eXBlIFNlcmlhbGl6ZWRFcnJvclR5cGUgPSB7XG4gIG5hbWU6IHN0cmluZztcbiAgbWVzc2FnZTogc3RyaW5nO1xufTtcbiJdfQ== |
{ | ||
"name": "@aws-amplify/platform-core", | ||
"version": "0.5.0-beta.3", | ||
"version": "0.5.0-beta.4", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145772
1564