aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_error_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-26 17:16:34 +0200
committerKim Alvefur <zash@zash.se>2020-09-26 17:16:34 +0200
commited5841e42b9c6b2ae31ba5f9a5767e67e2fb71d4 (patch)
treec95c7a9d17114faf5f603eefb6dc23d9d41db0f5 /spec/util_error_spec.lua
parenta34633771db29e751058f93b1abbfd6801283364 (diff)
downloadprosody-ed5841e42b9c6b2ae31ba5f9a5767e67e2fb71d4.tar.gz
prosody-ed5841e42b9c6b2ae31ba5f9a5767e67e2fb71d4.zip
util.error: Add well-known field 'extra'
A place for various extra fields and edge cases of the stanza error data model, e.g. the URI field of <gone>
Diffstat (limited to 'spec/util_error_spec.lua')
-rw-r--r--spec/util_error_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/util_error_spec.lua b/spec/util_error_spec.lua
index ca053285..136f8b12 100644
--- a/spec/util_error_spec.lua
+++ b/spec/util_error_spec.lua
@@ -66,5 +66,13 @@ describe("util.error", function ()
end);
end);
+ describe("extra", function ()
+ it("keeps some extra fields", function ()
+ local err = errors.new({condition="gone",text="Sorry mate, it's all gone",extra={uri="file:///dev/null"}});
+ assert.is_table(err.extra);
+ assert.equal("file:///dev/null", err.extra.uri);
+ end);
+ end)
+
end);