ledger: throw UserFacingException for OSError
Throws UserFacingException if the communication with the ledger fails due to an OSError. This happens e.g. if the Bitcoin app has been closed. We shouldn't get crash reports for errors due to disconnection.
This commit is contained in:
@@ -137,6 +137,11 @@ def test_pin_unlocked(func):
|
||||
return func(self, *args, **kwargs)
|
||||
except SecurityStatusNotSatisfiedError:
|
||||
raise UserFacingException(_('Your Ledger is locked. Please unlock it.'))
|
||||
except OSError as e:
|
||||
_logger.exception('')
|
||||
raise UserFacingException(
|
||||
_('Communication with Ledger failed. Open the Bitcoin app and try again.') + f'\n{str(e)}',
|
||||
)
|
||||
return catch_exception
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user