def convert_paramiko_errors(method):
    """Convert remote Paramiko errors to errors.RemoteError"""
    def wrapper(self, *args, **kw):
        try:
            return method(self, *args, **kw)
        except __HOLE__ as error:
            if error.errno == errno.ENOENT:
                raise errors.RemoteFileDoesNotExist(str(error))
            else:
                raise errors.RemoteError("%s: %s" % (error.__class__.__name__,
                                                     error))
        except (socket.error, paramiko.SSHException, EOFError) as error:
            raise errors.RemoteError("%s: %s" % (error.__class__.__name__,
                                                 error))

    wrapper.__doc__ = method.__doc__
    wrapper.__name__ = method.__name__

    return wrapper
dataset/ETHPy150Open ohmu/poni/poni/rcontrol_paramiko.py/convert_paramiko_errors