-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patherrors.js
39 lines (35 loc) · 887 Bytes
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module.exports.ParseError = class ParseError extends Error {
constructor(data) {
super("Parse error");
this.data = data;
this.statusCode = -32700;
}
};
module.exports.InvalidRequest = class InvalidRequest extends Error {
constructor(data) {
super("Invalid Request");
this.data = data;
this.statusCode = -32600;
}
};
module.exports.MethodNotFound = class MethodNotFound extends Error {
constructor(data) {
super("Method not found");
this.data = data;
this.statusCode = -32601;
}
};
module.exports.InvalidParams = class InvalidParams extends Error {
constructor(data) {
super("Invalid params");
this.data = data;
this.statusCode = -32602;
}
};
module.exports.InternalError = class InternalError extends Error {
constructor(data) {
super("Internal error");
this.data = data;
this.statusCode = -32603;
}
};