-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only show error stack if --verbose
flag is set
#18
Comments
|
Yeah, won't help. I'd like to find a solution to this, though. Want to hear other options to consider too. One is to start a convention of adding |
Agreed on all points made; |
Actually it's possible to assign function hello() {
const err = new Error('Hello World');
err.stack = undefined;
throw err;
}
hello();
//=> Error: hello world But maybe that's kinda hacky. |
I know, but we still want the stack. Just not show it. |
Then the only option is to add an extra flag. We just have to decide which one.
|
Wishing the concealed render mode ansi escape just stuck a bunch of text into a single invisible character so that when the user copied it would copy the entire stack, but not show it. Or that the console had a copy signal or something. |
They would probably remove it when pasting in GitHub as it was not visible in the console :). |
Potentially. Hmm. |
I just wish users didn't do dumb things :p |
I don't want |
|
^ This :) |
We could create a const UnicornError = require('unicorn-error');
throw new UnicornError('bar'); It behaves as a normal |
While |
Didn't knew you had one ;) I prefer |
Sindre is only truly serious about Thai food. I almost prefer |
I think either |
ohai @kevva 💃 I'm leaning more towards
However this is the most insane amount of bikeshedding at this point. |
We discussed this briefly in a commit in
dev-time-cli
.At the moment, when an error occurs and it is not handled by the developer, the entire error stack is shown.
When an error occurs, you got that "ugly" error string representation with the entire stacktrace. While this is very usefully, especially for debugging and reporting issues, it's not that user friendly.
proposal
Show a nice and clean error message. Something like
pageres
(but insteadlogSymbols.error
).If you want the entire stack trace, use the
--verbose
(or-v
) flag.Feedback and opinions more then welcome.
// @sindresorhus @kevva @Qix- @arthurvr
The text was updated successfully, but these errors were encountered: