Skip to content
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

Improve Trezor withdraw error, if canceled on device #1687

Open
yurii-khi opened this issue Feb 28, 2023 · 1 comment
Open

Improve Trezor withdraw error, if canceled on device #1687

yurii-khi opened this issue Feb 28, 2023 · 1 comment
Assignees

Comments

@yurii-khi
Copy link

yurii-khi commented Feb 28, 2023

Currently, if user doesn't confirm withdrawal on Trezor device,task::withdraw::status returns following error:

{
    "mmrpc": "2.0",
    "result": {
        "status": "Error",
        "details": {
            "error": "Internal error: Operation failed due to unknown reason: Failure { code: Some(FailureActionCancelled), message: Some(\"Action cancelled by user\") }",
            "error_path": "utxo_withdraw.with_trezor.client",
            "error_trace": "utxo_withdraw:323] with_trezor:36] client:90]",
            "error_type": "InternalError",
            "error_data": "Operation failed due to unknown reason: Failure { code: Some(FailureActionCancelled), message: Some(\"Action cancelled by user\") }"
        }
    },
    "id": null
}

Please note, that it has error_type == InternalError, and string error_data, making it hard to identify, and show to gui user.
It would be nice to provide more specific error data, similar to what we have for HwError error type, allowing to parse it properly and show human-friendly error message in gui.

Related webdex issue: https://github.com/KomodoPlatform/WebDEX/issues/925

@laruh
Copy link
Member

laruh commented Mar 1, 2023

Thanks for the issue, yeah we have couple todos related to this
https://github.com/KomodoPlatform/atomicDEX-API/blob/dev/mm2src/trezor/src/error.rs#L40
https://github.com/KomodoPlatform/atomicDEX-API/blob/dev/mm2src/crypto/src/hw_error.rs#L47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants