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 logging #111

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Improve error logging #111

merged 4 commits into from
Sep 18, 2024

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Sep 12, 2024

We used to panic on various errors in the releaser. Some stack traces are very large and maybe contain control characters, not allowing us to scroll back to the top of the error stack and needing an stty sane to restore the terminal.

This PR replaces panics by printing the error and the debug stack and exiting. It also handles inadvertent panics via a recover and logging.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps changed the title Reset terminal because some panics leave the terminal in a bad state Improve error logging Sep 13, 2024
@frouioui
Copy link
Member

frouioui commented Sep 18, 2024

Before merging this let's wait for @shlomi-noach to confirm that this fixes the issue he was experiencing with his terminal.

@rohit-nayak-ps
Copy link
Contributor Author

He already said it is not helping his issue: looks like there is something different in his shell/terminal environment. However I think switching from panic to outputing the error directly is a better solution since we then don't just get the "Abort" message and have to rerun it after redirecting outputs.

@frouioui frouioui merged commit 36ce4ab into main Sep 18, 2024
1 check passed
@frouioui frouioui deleted the sane-on-panic branch September 18, 2024 21:30
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

Successfully merging this pull request may close these issues.

3 participants