soundsense-rs
soundsense-rs copied to clipboard
Proper error handling and logging.
Currently, almost all unwrap and other potential errors cause the application to terminate. Proper error handling will be helpful in the long run.
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 anErr
value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1188:5 note: run withRUST_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.
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?
Yeah, that sounds helpful. Crashes have been rare for me, though.
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.