Changeset

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
parents 9569:0bc399953c27
children 9571:5c475f6e89a4
files util/serialization.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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 = {