mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
Pass validation errors with InvalidMessage error
Pass the array describing the validation errors occuring with the InvalidMessage error throw and print it to the console.
This commit is contained in:
1 parent
0a9fff7578
commit
43ce6aa58c
3 files changed
+14
-7
No files matched your search
@@ -90,7 +90,7 @@ describe("lib/link/link", function() {
|
||||
it("should throw on invalid message", function() {
|
||||
assert.throws(
|
||||
() => testLink.processMessage({ data: "invalid message" }),
|
||||
new errors.InvalidMessage("Malformed")
|
||||
{ message: "Malformed" }
|
||||
);
|
||||
});
|
||||
it("should throw on message without validator", function() {
|
||||
@@ -102,7 +102,7 @@ describe("lib/link/link", function() {
|
||||
it("should throw on message failing validation", function() {
|
||||
assert.throws(
|
||||
() => testLink.processMessage({ seq: 1, type: 'simple', data: { string: 1 }}),
|
||||
new errors.InvalidMessage("Validation failed for simple")
|
||||
{ message: "Validation failed for simple" }
|
||||
);
|
||||
});
|
||||
it("should throw on unhandled message", function() {
|
||||
|
||||
Reference in new issue
Block a user