aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/error.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/error.lua b/util/error.lua
index ade1bb3b..4079a876 100644
--- a/util/error.lua
+++ b/util/error.lua
@@ -42,16 +42,19 @@ local function new(e, context, registry, source)
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)