aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-03-22 12:13:19 +0100
committerorwell96 <orwell@bleipb.de>2021-03-22 12:40:54 +0100
commit2e281b134b8b73383f5422f5f735702a1e3163f0 (patch)
tree1656bffd3559fc4d51f7dc211794fbbb40d6ab4e
parenta6e8b8b4353863ad563a4d5187f40fea702ea2de (diff)
downloadadvtrains-2e281b134b8b73383f5422f5f735702a1e3163f0.tar.gz
advtrains-2e281b134b8b73383f5422f5f735702a1e3163f0.tar.bz2
advtrains-2e281b134b8b73383f5422f5f735702a1e3163f0.zip
Fix init.lua functions to do what is documented on error
-rw-r--r--init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 20ffa4d..afc6884 100644
--- a/init.lua
+++ b/init.lua
@@ -57,6 +57,7 @@ function serialize_lib.read_table_from_file(filename)
local succ, ret = pcall(ser.read_from_file, filename)
if not succ then
serialize_lib.log_error(ret)
+ return false,ret
end
return ret
end
@@ -67,8 +68,9 @@ function serialize_lib.write_table_to_file(root_table, filename)
local succ, ret = pcall(ser.write_to_file, root_table, filename)
if not succ then
serialize_lib.log_error(ret)
+ return false,ret
end
- return ret
+ return true
end