Skip to content

Conversation

AndrianoTurner
Copy link

@AndrianoTurner AndrianoTurner commented Sep 13, 2025

Addresses #58.
Removed std::process::exit(1) in favor of returning Err(e).

Copy link
Owner

@pythops pythops left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.
I think that wouldn't be enough actually.
You need to reset the terminal so you need to to catch when the app encounter the error and run tui.exit() then exit.

@AndrianoTurner
Copy link
Author

AndrianoTurner commented Sep 24, 2025

Will look into it

@AndrianoTurner
Copy link
Author

AndrianoTurner commented Sep 25, 2025

tui.init()?;
When this is called, the panic_hook is set, so i think the panic!() macro can be used when we encounter an unrecoverable error.

Currently when iwd is not running and the following code is executed:
https://github.com/pythops/impala/blob/944ad007ec8d02b13d410a186131b29c4b953f4c/src/main.rs#L32C4-L38C1
it returns true and the terminal resets because tui.exit() is called (which is what i wanted to fix).

So should i replace all std::process::exit() to panics which will call the panic hook, or propagate the errors?

@pythops
Copy link
Owner

pythops commented Sep 28, 2025

I think it is easier just to propagate the error and call tui.exit()? in main.rs

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.

2 participants