Change how errors objects are stringified. Use all properties, not only enumerable ones.
Related Issue
53
Motivation and Context
Stringify to JSON will omit non enumerable properties by default.
That the case when you try to stringify errors:
JSON.stringify(new Error("message", {cause: new Error("message 2")})) === "{}";
Example of the current output when upload a package when a more recent package was already uploaded:
$ npx @adobe/reactor-uploader "$PACKAGE_PATH" --org-id="$ORGANIZATION_ID" --private-key="$PRIVATE_KEY" --tech-account-id="$TECHNICAL_ACCOUNT_ID" --api-key="$API_KEY" --client-secret="$CLIENT_SECRET"
No development extension package was found on the server with the name [REDACTED]. A new extension package will be created.
--verbose output:
[REDACTED]/node_modules/@adobe/reactor-uploader/bin/handleResponseError.js:29
throw new Error(messagePrefix + ' ' + message);
^
Error: Error uploading extension package. An unknown error occurred: {}.
at module.exports ([REDACTED]/node_modules/@adobe/reactor-uploader/bin/handleResponseError.js:29:9)
at module.exports ([REDACTED]/node_modules/@adobe/reactor-uploader/bin/uploadZip.js:71:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async [REDACTED]/node_modules/@adobe/reactor-uploader/bin/index.js:82:32
Description
Change how errors objects are stringified. Use all properties, not only enumerable ones.
Related Issue
53
Motivation and Context
Stringify to JSON will omit non enumerable properties by default.
That the case when you try to stringify errors:
Example of the current output when upload a package when a more recent package was already uploaded:
How Has This Been Tested?
With
npm test
in codespaceTypes of changes
Checklist: