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 | 2e06e8e75d004d079ac264abc3f086051c4b62fb (patch) | |
tree | 5bed52709d37b9b174f19a1e29699040ec640e22 /util | |
parent | d496a96705c14722455f85f40f38b17fc5470606 (diff) | |
download | prosody-2e06e8e75d004d079ac264abc3f086051c4b62fb.tar.gz prosody-2e06e8e75d004d079ac264abc3f086051c4b62fb.zip |
util.datamanager: Remove check for file non-existence since ENOENT tells us that already
Diffstat (limited to 'util')
-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); |