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 cargo-pgrx error handling and reporting #1245

Open
BradyBonnette opened this issue Aug 1, 2023 · 0 comments
Open

Improve cargo-pgrx error handling and reporting #1245

BradyBonnette opened this issue Aug 1, 2023 · 0 comments
Labels
cargo-pgrx enhancement New feature or request

Comments

@BradyBonnette
Copy link
Contributor

BradyBonnette commented Aug 1, 2023

Originally brought up by @thomcc in issue #1222 and somewhat addressed by #1238, it was discussed that maybe cargo-pgrx has some bad UX when it comes to reporting error messages back to the user when things go wrong.

Some points that were brought up:

  • Maybe we really don't need eyre everywhere within cargo-pgrx. Even though eyre may be easy to use, sometimes it can be overzealous in its output. More output means more confusion to the user, and things may go overlooked
  • While tracing and derivatives are included in the cargo-pgrx crate, it was noted that any error always outputs a trace. See previous point about why this could be bad. While traces are good to have, we felt that having users "opt-in" to see traces is better than "default is on" for traces. There was discussion about whether or not tracing should even stay in the crate.
  • Ripping out eyre may mean implementing various Error types throughout the crate, which could be cumbersome (probably why eyre was introduced initially!)
  • Any kind of default error output should be succinct, to the point, and potentially (if possible!) describe what could be done to address the issue. Of course there are an awful lot of edge cases there, and sometimes the only way to know what needs to be done is to inspect the output of sub-commands that cargo-pgrx utilizes.
  • Many of the error reporting issues stem from the fact that cargo-pgrx uses std::process::Command frequently to achieve its goals, but the handling of spawning child processes, capturing their stdout/stderr, and possibly piping in stdin can be a bit tricky -- especially if you want to cover as many cases as possible. However, any kind of error reporting overhaul should not be limited to just anything that uses std::process::Command, but should be a crate-wide discovery and overhaul

Any other topics? The purpose of this issue is to collect some thoughts about what an overhaul might look like, and to potentially track any progress made towards that end.

@BradyBonnette BradyBonnette added enhancement New feature or request cargo-pgrx labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cargo-pgrx enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant