My project AdminBot has crashed a few times while I wasn't watching due to some .unwrap()s somewhere in the dependencies, but I haven't been able to isolate exactly where.
In order to avoid this issue, I've attempted to handle every case in Telebot where .unwrap() was used with some logic that doesn't involve panicking. In many places, this was doable by expanding on the .and_then() chains already present in the code.
I've done some light testing of these changes with my Telecord project, and verified that I can still send and receive text and files.
Some formatting unrelated to the .unwrap()s changed since my text editor automatically runs rustfmt
Well the error handling is at the moment improvable, perhaps we can switch to the promoted failure crate. I'll will look through the pull request, but I've noticed two things:
Conversion between result and future is quite messy (the Try operator would be helpful)
It would have been good if the formatting and code change were in seperate commits
My project AdminBot has crashed a few times while I wasn't watching due to some
.unwrap()
s somewhere in the dependencies, but I haven't been able to isolate exactly where.In order to avoid this issue, I've attempted to handle every case in Telebot where
.unwrap()
was used with some logic that doesn't involve panicking. In many places, this was doable by expanding on the.and_then()
chains already present in the code.I've done some light testing of these changes with my Telecord project, and verified that I can still send and receive text and files.
Some formatting unrelated to the
.unwrap()
s changed since my text editor automatically runsrustfmt