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 Error Handling and Logging #3

Open
cartermak opened this issue Mar 8, 2023 · 3 comments · May be fixed by #97
Open

Improve Error Handling and Logging #3

cartermak opened this issue Mar 8, 2023 · 3 comments · May be fixed by #97
Assignees
Labels
enhancement New/improved features and capabilities
Milestone

Comments

@cartermak
Copy link
Member

This is a general task to improve error handling and messages, including handling common special cases on a per-query basis. Examples:

  • Throw a TimeoutError instead of a RuntimeError for Hasura timeouts (common on large, complex queries)
  • Provide a message explaining that a plan ID is not available when trying to download a plan that doesn't exist
@cartermak
Copy link
Member Author

In general, I think there could be a larger task in implementing central logging in Aerie CLI that could print to stdout when used in a Python package, but have a custom stream handler implemented for CLI operation that would be able to wrap logs for pretty formatting and even support flexible log levels.

@cartermak cartermak changed the title Improve error handling Improve Error Handling and Logging Jul 12, 2023
@cartermak
Copy link
Member Author

Expanded idea:

The main entrypoint should catch all exceptions and gracefully exit. Because aerie-cli already has persistent file storage, we can add log files to that location and provide the full traceback there.

@cartermak
Copy link
Member Author

cartermak commented Aug 15, 2023

General goals:

  • Anytime Aerie-CLI throws an error that we don't handle gracefully, the full stacktrace should be save to a log file somewhere. Only a short message should be printed to the terminal, instead of the full stacktrace.
  • At the top level (probably in main() of __main__.py), we should catch all exceptions such that the program always exists gracefully
  • Implement logging such that we can log debug-level, info-level, etc. from all methods in Aerie-CLI. This will include defining a top-level logger object somewhere that's accessible from all the commands and AerieClient. A custom stream handler should print pretty log messages to the terminal (using the rich library). An additional Aerie-CLI global argument can configure the logging level.

@cartermak cartermak linked a pull request Jan 29, 2024 that will close this issue
@cartermak cartermak added the enhancement New/improved features and capabilities label Jan 29, 2024
@cartermak cartermak added this to the v3 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved features and capabilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants