From 298ed31cbf140d118546ddcb7f45772d29f0218a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Oct 2018 12:56:01 +0200 Subject: util.serialization: Encode non-fatal error in way that can be restored It could previously encode to eg `{ [nil] = ... }` which doesn't get decoded --- util/serialization.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = { -- cgit v1.2.3