launchdarkly / rust-server-sdk

LaunchDarkly Server-Side SDK for Rust
https://docs.launchdarkly.com/sdk/server-side/rust
Other
18 stars 13 forks source link

Implement all error types using enums and thiserror #3

Closed mraerino closed 2 years ago

mraerino commented 3 years ago

Is your feature request related to a problem? Please describe.

For people using this library it would be awesome if all error types implemented Debug & Display so it's easy to wrap them in our own code.

Describe the solution you'd like

If all parts of the code defined their error types using enums they could derive thiserror::Error.

This is a very approachable pattern for maintainers of the SDK as well as users.

Describe alternatives you've considered n/a

Additional context You can see a bunch of those in my take on an SDK: https://github.com/mraerino/launchdarkly-rust-sdk-experimental/search?q=thiserror%3A%3AError

keelerm84 commented 2 years ago

Thank you for the suggestion. The latest beta release of the SDK takes advantage of thiserror::Error as you suggested!