adobe / aio-cli-plugin-app

Create, Build and Deploy Cloud Native Applications
Apache License 2.0
19 stars 35 forks source link

using verbose flag sometimes results in TypeError #795

Closed MichaelGoberling closed 2 months ago

MichaelGoberling commented 2 months ago

Describe the bug running aio app <command> --verbose sometimes results in the following error:

TypeError: first argument must be a string or instance of Error

this is because errors caught by the BaseCommand dont always have stack traces (error.stack) https://github.com/adobe/aio-cli-plugin-app/blob/master/src/BaseCommand.js#L38

To Reproduce Steps to reproduce the behavior:

Expected behavior

(funny enough the expected behavior is what you see when you dont use the --verbose flag)

Potential solution

just check for the stack trace (flags.verbose && error.stack)

MichaelGoberling commented 2 months ago

fwiw, stack is an optional field of Error https://stackoverflow.com/a/75109213/22265578

aiojbot commented 2 months ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2955