Skip to content
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

Better error output #53

Closed
antonmedv opened this issue May 10, 2021 · 7 comments
Closed

Better error output #53

antonmedv opened this issue May 10, 2021 · 7 comments

Comments

@antonmedv
Copy link
Collaborator

Will be cool to add colors to error output of uncatched errors.

@pi0
Copy link

pi0 commented May 10, 2021

I would suggest trying consola. We can hook into all console calls to catch and format both logs and errors/stacks. (in conflict with #52 but is easily solvable)

@antonmedv
Copy link
Collaborator Author

Looks nice, but kind of too heavy. Will be cool to find something lightweight and focusing only on pretty-printing errors.

@pi0
Copy link

pi0 commented May 11, 2021

but kind of too heavy

By install size? It is almost same install size of chalk (#52) due to actually using it :D Anyway this might be helpful for formatting stack to reduce verbosity:

@antonmedv
Copy link
Collaborator Author

Also from the screenshot looks like it not printing code snippet there error thrown.

Will be cool to have code also printed as it does in standard error printing.

@pi0
Copy link

pi0 commented May 11, 2021

Hmm, reading and printing code around could be nice. But it involves a more complex setup to try reading from file-system using a search path since usually stack traces are not absolute or relative to cwd also we may use source-map to reverse to original source.

Please let me know about your decision would be happy to help to implement either directly in zx or as a consola reporter (extending fancy for code-snippet support). Consola had been battle-tested for a long time in different setups and the core overhead is not that much comparing to essential infra is providing for the same purpose of improving CLI output.

@antonmedv
Copy link
Collaborator Author

Both ways are fine.

@antonmedv
Copy link
Collaborator Author

Errors mostly okay now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants