• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-cli / 7504397399

12 Jan 2024 03:50PM UTC coverage: 93.638%. Remained the same
7504397399

Pull #336

github

web-flow
Merge c83933aeb into 7a5c68aa2
Pull Request #336: Bump coverage from 7.3.4 to 7.4.0

1987 of 2122 relevant lines covered (93.64%)

3.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.83
/safe_cli/operators/hw_wallets/ledger_exceptions.py
1
import functools
4✔
2

3
from ledgereth.exceptions import (
4✔
4
    LedgerAppNotOpened,
5
    LedgerCancel,
6
    LedgerLocked,
7
    LedgerNotFound,
8
)
9

10
from ..exceptions import HardwareWalletException
4✔
11
from .exceptions import InvalidDerivationPath
4✔
12

13

14
def raise_ledger_exception_as_hw_wallet_exception(function):
4✔
15
    @functools.wraps(function)
4✔
16
    def wrapper(*args, **kwargs):
4✔
17
        try:
4✔
18
            return function(*args, **kwargs)
4✔
19
        except LedgerNotFound as e:
4✔
20
            raise HardwareWalletException(e.message)
4✔
21
        except LedgerLocked as e:
4✔
22
            raise HardwareWalletException(e.message)
4✔
23
        except LedgerAppNotOpened as e:
4✔
24
            raise HardwareWalletException(e.message)
4✔
25
        except LedgerCancel as e:
4✔
26
            raise HardwareWalletException(e.message)
4✔
27
        except InvalidDerivationPath as e:
4✔
28
            raise HardwareWalletException(e.message)
4✔
29
        except BaseException as e:
4✔
30
            if "Error while writing" in e.args:
4✔
31
                raise HardwareWalletException("Ledger error writting, restart safe-cli")
×
32
            raise e
4✔
33

34
    return wrapper
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc