demoscene-rs / rust-rocket

gnu rocket client library in rust
MIT License
20 stars 7 forks source link

Add Error implementation and variants with thiserror #4

Closed gustafla closed 3 years ago

gustafla commented 3 years ago

Hello and thanks for this great crate. I added some error variants like issue #3 suggests. However, I also messed up your codebase by changing the edition to 2018 and adding thiserror as a dependency for generating the Display implementation for errors. I also renamed RocketErr to just Error because I believe it's less redundant and more predictable that way. Sorry if you dislike some of my changes in this PR, I can rework it if needed. Also, should we handle at least some of the in-session Errors with returning a Result instead of panicing so that users can try to reconnect?

gustafla commented 3 years ago

Also about that Cargo.toml authors field, I don't need to be credited as an author if you don't want to. I can't claim to know how exactly Rocket works so I cannot take too much responsibility

Darksecond commented 3 years ago

I've looked at your code and it looks great, yes. I think replacing all panics with errors is a good next step but I will merge this for now!