Software /
code /
prosody
Diff
util/serialization.lua @ 9570:ce403b6470f8
util.serialization: Encode non-fatal error in way that can be restored
It could previously encode to eg `{ [nil] = ... }` which doesn't get decoded
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 27 Oct 2018 12:56:01 +0200 |
parent | 9569:0bc399953c27 |
child | 9692:affcbccc1dff |
child | 10060:7a36b7ac309b |
line wrap: on
line diff
--- a/util/serialization.lua Sat Oct 27 12:54:57 2018 +0200 +++ b/util/serialization.lua Sat Oct 27 12:56:01 2018 +0200 @@ -39,7 +39,7 @@ 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 = {