Change main to return a Result. Fatal errors can be propagated up to main,
which will print the error message and exit with a failure code.
Update app to return errors instead of panicking.
Before:
19:29:12 [ERROR] Could not load configuration: configuration file "/Users/user/Library/Preferences/display-switch.ini" not found
thread 'main' panicked at 'Configuration error', src/app.rs:45:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
After:
Error: configuration file "/Users/user/Library/Preferences/display-switch.ini" not found
Change
main
to return a Result. Fatal errors can be propagated up tomain
, which will print the error message and exit with a failure code.Update
app
to return errors instead of panicking.Before:
After: