mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +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
+6
-1
@@ -7,7 +7,12 @@ class CommandError extends Error { }
|
||||
class RequestError extends Error { }
|
||||
|
||||
// Signal for messages that fail validation
|
||||
class InvalidMessage extends Error { }
|
||||
class InvalidMessage extends Error {
|
||||
constructor(msg, errors) {
|
||||
super(msg);
|
||||
this.errors = errors || null;
|
||||
}
|
||||
}
|
||||
|
||||
// Errror class for known errors occuring during startup
|
||||
class StartupError extends Error { }
|
||||
|
||||
Reference in new issue
Block a user