aboutsummaryrefslogtreecommitdiffstats
path: root/util/serialization.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-27 12:56:01 +0200
committerKim Alvefur <zash@zash.se>2018-10-27 12:56:01 +0200
commita261de73b9e71b4fc51bfb0afd8fc41148b41801 (patch)
treeb4f91c97b80ff99b022cb79cd9d70c312b6071e4 /util/serialization.lua
parent14978069896e87083fd46795cc26b2f58b24828f (diff)
downloadprosody-a261de73b9e71b4fc51bfb0afd8fc41148b41801.tar.gz
prosody-a261de73b9e71b4fc51bfb0afd8fc41148b41801.zip
util.serialization: Encode non-fatal error in way that can be restored
It could previously encode to eg `{ [nil] = ... }` which doesn't get decoded
Diffstat (limited to 'util/serialization.lua')
-rw-r--r--util/serialization.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/serialization.lua b/util/serialization.lua
index 8ef8048d..dd6a2a2b 100644
--- a/util/serialization.lua
+++ b/util/serialization.lua
@@ -39,7 +39,7 @@ local function fatal_error(obj, why)
end
local function nonfatal_fallback(x, why)
- return s_format("nil --[[%s: %s]]", type(x), why or "fail");
+ return s_format("{__type=%q,__error=%q}", type(x), why or "fail");
end
local string_escapes = {