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

safe-global / safe-cli / 12948124027

24 Jan 2025 10:47AM UTC coverage: 88.612%. Remained the same
12948124027

Pull #492

github

web-flow
Merge 2829062b7 into 3ba0a8ce9
Pull Request #492: Fix typos

221 of 262 branches covered (84.35%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

2868 of 3224 relevant lines covered (88.96%)

2.67 hits per line

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

96.0
/src/safe_cli/operators/hw_wallets/ledger_exceptions.py
1
import functools
3✔
2

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

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

13

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

34
    return wrapper
3✔
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

© 2026 Coveralls, Inc