def wrap_exception(func: Callable) -> Callable:
    """Wrap all IOErrors to BluetoothBackendException"""

    def _func_wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except IOError as exception:
            raise BluetoothBackendException() from exception
    return _func_wrapper
Wrap all IOErrors to BluetoothBackendException