# HG changeset patch # User Kim Alvefur # Date 1540637761 -7200 # Node ID ce403b6470f863cfd0464f74722ca100cb5951e9 # Parent 0bc399953c2716b990e4da8b4e2455167ce7f06b util.serialization: Encode non-fatal error in way that can be restored It could previously encode to eg `{ [nil] = ... }` which doesn't get decoded diff -r 0bc399953c27 -r ce403b6470f8 util/serialization.lua --- 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 = {