diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-27 12:56:01 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-27 12:56:01 +0200 |
commit | 298ed31cbf140d118546ddcb7f45772d29f0218a (patch) | |
tree | b4f91c97b80ff99b022cb79cd9d70c312b6071e4 | |
parent | 41e8cd3148ebeebef6e36d54c0bc1c5e4bb36cd9 (diff) | |
download | prosody-298ed31cbf140d118546ddcb7f45772d29f0218a.tar.gz prosody-298ed31cbf140d118546ddcb7f45772d29f0218a.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
-rw-r--r-- | util/serialization.lua | 2 |
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 = { |