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

Improve CLI error handling and display #2275

Open
6 tasks
schoren opened this issue Mar 29, 2023 · 0 comments
Open
6 tasks

Improve CLI error handling and display #2275

schoren opened this issue Mar 29, 2023 · 0 comments
Labels

Comments

@schoren
Copy link
Collaborator

schoren commented Mar 29, 2023

Our current CLI does not handle errors in a helpful way. When users hit errors, it's very unfriendly to understand or figure out solutions.

We can improve that by providing user friendly messages, improved loggin, validation of command parameters with useful messages and simplified mechanism for reporting bugs.

We want to follow the Command Line Interface Guidelines

Tasks:

  • show cli and server version when outputting an error.
  • basic mapping of known errors into user friendly messages
  • add a panic handler to handle unknown errors (a.k.a suggesting bug reporting).
    • if CI=false, prompt users if they want to report the bug, use GH API to create an issue, with the related log file attached (and other info we thing is relevant)
    • if CI=true, show a copy/pasteable URL to GH Issues form with relevant values prepopulated in the URL query string params. At least include cli version, server version, deployment type (docker/k8s), command run, latest error message.
  • have a tmp directory to contain logs. Each command run would create a log file, for example /tmp/tracetest/timestamp.log regardless of the command succeeding or not. It contains all debug log entries. If we detect an error, we point the user to that file for more details.
  • Also add sentry to log all errors. cli needs to check with server if analytics enabled before logging to sentry. If the error is
  • error output must be user friendly, and point users to relevant log for details. If possible, provide suggested actions to fix.
We couldn’t communicate with the configured server (http://localhost:11633/)

to see more details check the log file a /tmp/tracetest/whatever.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant