# HG changeset patch # User Kim Alvefur # Date 1490180572 -3600 # Node ID f4c0fb54e16c3bd7467a8ec1375371c29335793b # Parent b99404a340fcda3c0473bc940e882139401aae84 util.datamanager: Remove check for file non-existence since ENOENT tells us that already diff -r b99404a340fc -r f4c0fb54e16c util/datamanager.lua --- a/util/datamanager.lua Wed Mar 22 12:00:21 2017 +0100 +++ b/util/datamanager.lua Wed Mar 22 12:02:52 2017 +0100 @@ -132,15 +132,8 @@ -- No such file, ok to ignore return nil; end - local mode = lfs.attributes(getpath(username, host, datastore), "mode"); - if not mode then - log("debug", "Assuming empty %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); - return nil; - else -- file exists, but can't be read - -- TODO more detailed error checking and logging? - log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); - return nil, "Error reading storage"; - end + log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); + return nil, "Error reading storage"; end local success, ret = pcall(data); @@ -306,15 +299,8 @@ -- No such file, ok to ignore return nil; end - local mode = lfs.attributes(getpath(username, host, datastore, "list"), "mode"); - if not mode then - log("debug", "Assuming empty %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); - return nil; - else -- file exists, but can't be read - -- TODO more detailed error checking and logging? - log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); - return nil, "Error reading storage"; - end + log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil"); + return nil, "Error reading storage"; end local success, ret = pcall(data);