aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-01 18:31:12 +0100
committerKim Alvefur <zash@zash.se>2019-11-01 18:31:12 +0100
commit3ba24f4366692a0bb2c8df19a034ac37c731428e (patch)
tree4e7fb78094e2e7567194135f6eed094fe337e771 /util
parentd8226abd24c7c37e48ccb7fefba816084dbec860 (diff)
downloadprosody-3ba24f4366692a0bb2c8df19a034ac37c731428e.tar.gz
prosody-3ba24f4366692a0bb2c8df19a034ac37c731428e.zip
util.error: Add well-known field 'code' in error templates
Intended to be for HTTP-ish numeric status codes
Diffstat (limited to 'util')
-rw-r--r--util/error.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/error.lua b/util/error.lua
index 23551fe2..9ebfa6ab 100644
--- a/util/error.lua
+++ b/util/error.lua
@@ -14,6 +14,7 @@ local function new(e, context, registry)
type = template.type or "cancel";
condition = template.condition or "undefined-condition";
text = template.text;
+ code = template.code or 500;
context = context or template.context or { _error_id = e };
}, error_mt);