aboutsummaryrefslogtreecommitdiffstats
path: root/spec
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
commit03adb505558555cd2449bea0ae83c0a89c82a399 (patch)
tree4e7fb78094e2e7567194135f6eed094fe337e771 /spec
parent9f13e20ffef42d61a3f72a3b11a68125557667c3 (diff)
downloadprosody-03adb505558555cd2449bea0ae83c0a89c82a399.tar.gz
prosody-03adb505558555cd2449bea0ae83c0a89c82a399.zip
util.error: Add well-known field 'code' in error templates
Intended to be for HTTP-ish numeric status codes
Diffstat (limited to 'spec')
-rw-r--r--spec/util_error_spec.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/util_error_spec.lua b/spec/util_error_spec.lua
index d8534c2b..ca053285 100644
--- a/spec/util_error_spec.lua
+++ b/spec/util_error_spec.lua
@@ -16,11 +16,13 @@ describe("util.error", function ()
["fail"] = {
type = "wait",
condition = "internal-server-error",
+ code = 555;
};
};
local err = errors.new("fail", { traceback = "in some file, somewhere" }, templates);
assert.equal("wait", err.type);
assert.equal("internal-server-error", err.condition);
+ assert.equal(555, err.code);
assert.same({ traceback = "in some file, somewhere" }, err.context);
end);
end);