soundsense-rs icon indicating copy to clipboard operation
soundsense-rs copied to clipboard

Proper error handling and logging.

Open prixt opened this issue 5 years ago • 4 comments

Currently, almost all unwrap and other potential errors cause the application to terminate. Proper error handling will be helpful in the long run.

prixt avatar Feb 12 '20 13:02 prixt

I got one of those unwrap errors for the first time today while I left SoundSense-RS running. The game was paused and only music was playing at the time.

Just in case it's helpful:

thread 'sound_thread' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1188:5 note: run with RUST_BACKTRACE= environment variable to display a backtrace.

Does that mean there's a problem with the sound pack trying to play a music file that doesn't exist?

It didn't seem to have crashed, but it stopped playing music.

jecowa avatar Feb 15 '20 08:02 jecowa

Yeah, the UI and sound run on a different thread. When there is a crash on the UI, the whole program crashes, but when there is a crash on the sound, the UI stays. Maybe adding an alert displaying the sound thread crash error message will help for users who won't use a version with console?

prixt avatar Feb 18 '20 02:02 prixt

Yeah, that sounds helpful. Crashes have been rare for me, though.

jecowa avatar Feb 18 '20 05:02 jecowa

Added some error handling in v1.4.4. I don't think it'll catch all errors though. Please report any missed errors that don't get displayed on the UI as an alert.

prixt avatar Feb 18 '20 13:02 prixt