c12i / mpesa-rust

A MPESA API sdk in Rust
https://c12i.github.io/mpesa-rust/mpesa/index.html
MIT License
43 stars 14 forks source link

Clean up error enum #69

Closed c12i closed 7 months ago

c12i commented 1 year ago

Currrent enum is pretty much a ball of mud enum that exposes unnecessary internal implementations that the end user doesn't really need to know about and continues to grow bigger and bigger with every new feature that gets added to the SDK.

Suggestion would be to separate internal and user facing errors from the enum, ultimately we would have the following variants (pseudocode)

HttpError(ApiError)
InternalError(InternalErrors)
ValidationError(&'static str)
c12i commented 7 months ago

Closing since this has been addressed #89