diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-22 12:02:52 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-22 12:02:52 +0100 |
commit | 04002ee277caaa45d1346d734024b7d9709f6cd8 (patch) | |
tree | 5bed52709d37b9b174f19a1e29699040ec640e22 /util/datamanager.lua | |
parent | c92972b13763ff524e8935aa001be2c94dad113f (diff) | |
download | prosody-04002ee277caaa45d1346d734024b7d9709f6cd8.tar.gz prosody-04002ee277caaa45d1346d734024b7d9709f6cd8.zip |
util.datamanager: Remove check for file non-existence since ENOENT tells us that already
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r-- | util/datamanager.lua | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index d0a81e71..b825cb33 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -132,15 +132,8 @@ local function load(username, host, datastore) -- 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 @@ local function list_load(username, host, datastore) -- 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); |