-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error codes to topup #70
Conversation
d19ac9f
to
754ddee
Compare
754ddee
to
70c76e4
Compare
crow/src/lib.rs
Outdated
}) | ||
} | ||
|
||
pub fn from_topup_error(error: Option<TopupError>) -> Option<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove it if we do not use it here.
The reason is that imagine we will change the string representations here, but the client is using it to store information in a db, they will not be able to read old records. It is the client responsibility to find a stable way to represent enum values as string.
crow/src/lib.rs
Outdated
_ => TopupError::TemporaryFailure { | ||
code: TemporaryFailureCode::Unexpected, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => TopupError::TemporaryFailure { | |
code: TemporaryFailureCode::Unexpected, | |
}, | |
e => TopupError::PermanentFailure { | |
code: PermanentFailureCode::Unexpected { msg: e.to_string() }, | |
}, |
Co-authored-by: Daniel Granhão <32176319+danielgranhao@users.noreply.github.com>
ef8f180
to
672c429
Compare
No description provided.