--- a/util/error.lua Fri Sep 25 12:19:30 2020 +0100
+++ b/util/error.lua Fri Sep 25 12:27:45 2020 +0100
@@ -42,16 +42,19 @@
context.traceback = debug.traceback("error stack", 2);
end
- return setmetatable({
+ local error_instance = setmetatable({
instance_id = id.short();
+
type = template.type or "cancel";
condition = template.condition or "undefined-condition";
text = template.text;
code = template.code;
- context = context or template.context or { _error_id = e };
+ context = context;
source = source;
}, error_mt);
+
+ return error_instance;
end
local function init(source, registry)