-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Misc]: Improve error handling by adding contexts #3806
Conversation
* Use `TWError` in `tw_coin_entry`
…tw_native_evmos`, `tw_native_injective`, `tw_thorchain`
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.
I checked tw_coin_entry::error
and it looks good imo. The intended usage of this seems to be for debugging purposes via the Display
trait (ie. format_context
), I assume?
Hi @lamafab, exactly. |
Binary size comparison➡️ aarch64-apple-ios: - 11.50 MB
+ 11.72 MB +232 KB ➡️ aarch64-apple-ios-sim: - 11.50 MB
+ 11.72 MB +232 KB ➡️ aarch64-linux-android: - 14.84 MB
+ 15.22 MB +383 KB ➡️ armv7-linux-androideabi: - 12.48 MB
+ 12.71 MB +239 KB ➡️ wasm32-unknown-emscripten: - 10.25 MB
+ 10.55 MB +307 KB |
Description
Currently, it's complicated to debug errors WalletCore returns, especially if the error is related to incorrect
SigningInput
parameters, as the error codes are too abstract, egSigningError::Error_invalid_params
,SigningError::Error_invalid_address
and other.In this PR, we introduce error contexts - an extension of the error messages that will help to find out which request parameter leads to the error.
Example:
How to test
Run Rust, C++ tests
Types of changes
Checklist
If you're adding a new blockchain