def errnoToFailure(e, path):
 if (e == errno.ENOENT):
  return defer.fail(FileNotFoundError(path))
 elif ((e == errno.EACCES) or (e == errno.EPERM)):
  return defer.fail(PermissionDeniedError(path))
 elif (e == errno.ENOTDIR):
  return defer.fail(IsNotADirectoryError(path))
 elif (e == errno.EEXIST):
  return defer.fail(FileExistsError(path))
 elif (e == errno.EISDIR):
  return defer.fail(IsADirectoryError(path))
 else:
  return defer.fail()

def errnoToFailure ( e , path ) : if ( e == errno . ENOENT ) : return defer . fail ( FileNotFoundError ( path ) ) elif ( ( e == errno . EACCES ) or ( e == errno . EPERM ) ) : return defer . fail ( PermissionDeniedError ( path ) ) elif ( e == errno . ENOTDIR ) : return defer . fail ( IsNotADirectoryError ( path ) ) elif ( e == errno . EEXIST ) : return defer . fail ( FileExistsError ( path ) ) elif ( e == errno . EISDIR ) : return defer . fail ( IsADirectoryError ( path ) ) else : return defer . fail ( )
map c{oserror} and c{ioerror} to standard ftp errors .