adobe / reactor-uploader

Command line tool for uploading Adobe Experience Platform Tags extensions.
Apache License 2.0
9 stars 11 forks source link

Log non enumerable properties of unknow error objects #53

Closed mems closed 1 year ago

mems commented 1 year ago

Expected Behaviour

When the server return an error when uploading a package, an error message is ouput with the error details:

Error: Error uploading extension package. An unknown error occurred: {"message": "Newer version already uploaded"}.

Actual Behaviour

The error message is not present:

Error: Error uploading extension package. An unknown error occurred: {}.

This is due to how properties are defined for errors types: javascript - Is it not possible to stringify an Error using JSON.stringify? - Stack Overflow

Reproduce Scenario (including but not limited to)

Get a server error that will be logged, or a network issue (offline)

Steps to Reproduce

  1. create an extension 1.0.0
  2. upload it
  3. release it
  4. update the version to 0.9.0
  5. upload it

Sample Code that illustrates the problem

JSON.stringify(new Error("message", {cause: new Error("message 2")})) === "{}";
jeffreywalter commented 1 year ago

@adobe export issue to Jira project PDCL as Story

brenthosie commented 1 year ago

@adobe export issue to Jira project PDCL

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue PDCL-9872 is successfully created for this GitHub issue.

brenthosie commented 1 year ago

Merged to v5.1.0: https://github.com/adobe/reactor-uploader/pull/54