alexa / ask-cli

Alexa Skills Kit Command Line Interface
https://developer.amazon.com/en-US/docs/alexa/smapi/ask-cli-intro.html
Apache License 2.0
167 stars 54 forks source link

fix: prevent errors to be displayed as [Error]: [object Object] #478

Closed doiron closed 1 year ago

doiron commented 1 year ago

some reports of failures deploying were displaying error outputs on the terminal as

[Error]: [object Object]

this PR resolves this issue by updating the Messenger class directly to call jsonview.toString() which internally calls JSON.stringify on the object. Confirmed that it now prints the error but it's also unfortunately stringified. However now we can see the error messages and stack.

[Error]: "{\n  \"message\": \"TEST_MESSAGE\",\n  \"stack\": \"TEST_STACK\"}"

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

UniSnake commented 1 year ago

I'm still experiencing this or something like this in 2.30.3 I'm using a Windows PowerShell terminal.

PS C:\dev\STG> ask deploy --ignore-hash
Deploy configuration loaded from ask-resources.json
Deploy project for profile [default]

==================== Deploy Skill Metadata ====================
Uploading the entire skill package and building the models. Normally it takes a few minutes...
  √ Using pre-existing skill id: <snipped>
  √ Importing skill using import id: <snipped>
  √ [Interaction Model] build is complete.
[Warn]: [object Object]
Skill package deployed and all models built successfully.

Note the [Warn]: [object Object]