diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-27 12:54:57 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-27 12:54:57 +0200 |
commit | 41e8cd3148ebeebef6e36d54c0bc1c5e4bb36cd9 (patch) | |
tree | 83d0aa90ed5058e4248a499d811db5d47c990aba /util | |
parent | 9bd5cf34cf3a9c9757afbb10b2aeb0534562df01 (diff) | |
download | prosody-41e8cd3148ebeebef6e36d54c0bc1c5e4bb36cd9.tar.gz prosody-41e8cd3148ebeebef6e36d54c0bc1c5e4bb36cd9.zip |
util.serialization: Rename non-fatal fallback handler for clarity
Diffstat (limited to 'util')
-rw-r--r-- | util/serialization.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/serialization.lua b/util/serialization.lua index 52e89136..8ef8048d 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -38,7 +38,7 @@ local function fatal_error(obj, why) error("Can't serialize "..type(obj) .. (why and ": ".. why or "")); end -local function default_fallback(x, why) +local function nonfatal_fallback(x, why) return s_format("nil --[[%s: %s]]", type(x), why or "fail"); end @@ -84,7 +84,7 @@ local function new(opt) opt.preset = "oneline"; opt.freeze = true; opt.fatal = false; - opt.fallback = default_fallback; + opt.fallback = nonfatal_fallback; opt.unquoted = true; end if opt.preset == "oneline" then @@ -100,7 +100,7 @@ local function new(opt) opt.unquoted = true; end - local fallback = opt.fallback or opt.fatal == false and default_fallback or fatal_error; + local fallback = opt.fallback or opt.fatal == false and nonfatal_fallback or fatal_error; local function ser(v) return (types[type(v)] or fallback)(v); |