rust-x-bindings / rust-xcb

Rust bindings and wrapper for XCB.
MIT License
162 stars 64 forks source link

Implement std::error::Error for xcb::ProtocolError and xcb::Error #140

Closed pr2502 closed 2 years ago

pr2502 commented 2 years ago

Hi, this is a very basic implementation, it just reuses the Debug print of ProtocolError as the Display print, I don't know if xcb has some mechanism to turn the error codes into human readable messages but considering that Display doesn't have any stability guarantees and the ergonomic improvements of working with errors implementing std::error::Error I think this is better than nothing.

pr2502 commented 2 years ago

oops https://github.com/rust-x-bindings/rust-xcb/runs/4750253689?check_suite_focus=true#step:4:13