[CLI] Remove stack trace from CLI's stdout messages
See original GitHub issueEnvironment
@boostercloud/cli/0.3.3 darwin-x64 node-v12.16.3
Steps to reproduce it:
You just need to generate an error executing a CLI command, for instance, having on purpose a wrong AWS credentials configuration.
Expected result
Stack trace could be removed from those messages because it doesn’t help much the user. In fact, in previous versions like 0.2.1, there was no stack trace:
$ boost deploy -e production
ℹ boost deploy [production] 🚀
ℹ Bootstrapping the following environment: {"name":"Default environment","account":"155431809731","region":"us-east-1"}
✖ The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. (You can see the full error logs in ./errors.log)
Result
$ boost deploy -e production
ℹ boost deploy [production] 🚀
ℹ Bootstraping the following environment: {"name":"Default environment","account":"155431809731","region":"us-east-1"}
✖ SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
at Request.extractError (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/protocol/query.js:50:29)
at Request.callListeners (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/Users/glammers/development/theam/my-first-booster-project/node_modules/@boostercloud/framework-provider-aws-infrastructure/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
When value of key attribute is null, CLI writes a stack trace ...
When value of key attribute is null, CLI writes a stack trace to stdout #94 ... --encryption-context class=log ` >> --suppress-metadata ...
Read more >Do not print stack-trace using Pool python
This works when when the output on STDOUT and STDERR isn't too big. Else when another process than the one communicate() is currently ......
Read more >Print or retrieve a stack traceback
Source code: Lib/traceback.py This module provides a standard interface to extract, format and print stack traces of Python programs.
Read more >suppressing TestFailedException stack trace in sbt
I'm not sure whether this is rightly a ScalaTest or sbt question, but is there a way to suppress the printing of the...
Read more >Configuring CLI output verbosity with logging and argparse
Command -line interfaces frequently produce output whose verbosity your users may want to be able to tweak. Here's a nifty way to do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess this is a matter of taste, and I see that most of you prefer to avoid seeing the whole stack trace. Let’s do it as @glammers1 suggested: dump the stack trace to a file and say something like “this failed, you can find the full stack trace in ./errors.log”. We can have the
--verbose
flag too, but it can’t be the only option. There are some situations where running the command again with--verbose
would not be the best idea (for instance, when a very long deploy fails, or when the error have produced some side effect that you don’t want to repeat)I’ve edited the issue description to show a
(You can see the full error logs in ./errors.log)
string after the error message.