Articles tagged #errors
Page 1
Improving error handling - panics vs. proper errors
Before we move on to parsing more of our raw packets, I want to take some time to improve our error handling strategy.
Currently, the ersatz
codebase contains a mix of Result<T, E>
, and some
methods that panic, like unwrap()
and expect()
.
We also have a custom Error
enum that lets us return rawsock errors, IO errors,
or Win32 errors:
Rust code
pub Rawsockrawsock IOstdio Win32
Page 1
Go back to the homepage.