aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit52551bb262a188ecf27e1658790fd76437bcf08a (patch)
treeb4f91c97b80ff99b022cb79cd9d70c312b6071e4 /util
parentf52dc4985c2cd97bdf3f9807b029793e921c59cf (diff)
downloadprosody-52551bb262a188ecf27e1658790fd76437bcf08a.tar.gz
prosody-52551bb262a188ecf27e1658790fd76437bcf08a.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')
-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 = {