1
0

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:
f321x
2025-12-10 16:48:17 +01:00
parent 6d1e8e8619
commit aa47a960a7

View File

@@ -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