-
-
Notifications
You must be signed in to change notification settings - Fork 314
Collapse file tree
Files
Search this repository
/
Copy patherrors.js
More file actions
More file actions
Latest commit
53 lines (46 loc) · 2.07 KB
/
errors.js
File metadata and controls
53 lines (46 loc) · 2.07 KB
You must be signed in to make or propose changes
More edit options
Edit and raw actions
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module.exports = {
NoDefinitionsFound: class NoDefinitionsFound extends Error {
constructor (additionalInfo = {}) {
super();
this.name = 'NoDefinitionsFound';
this.title = 'No Definitions Found';
this.message = 'Sorry pal, we couldn\'t find definitions for the word you were looking for.';
this.resolution = 'You can try the search again at later time or head to the web instead.';
this.additionalInfo = additionalInfo;
this.requestType = 'notFound';
}
},
RateLimitError: class RateLimitError extends Error {
constructor (additionalInfo = {}) {
super();
this.name = 'RateLimitError';
this.title = 'API Rate Limit Exceeded';
this.message = 'Sorry pal, you were just rate limited by the upstream server.';
this.resolution = 'You can try the search again at later time or head to the web instead.';
this.additionalInfo = additionalInfo;
this.requestType = 'rateLimit';
}
},
UnexpectedError: class UnexpectedError extends Error {
constructor (additionalInfo = {}) {
super();
this.name = 'UnexpectedError';
this.title = 'Something Went Wrong';
this.message = 'Sorry pal, something went wrong, and it\s not your fault.';
this.resolution = 'You can try the search again at later time or head to the web instead.';
this.additionalInfo = additionalInfo;
this.requestType = 'serverError';
}
},
BadHTTPResponse: class BadHTTPResponse extends Error {
constructor (additionalInfo = {}) {
super();
this.name = 'BadHTTPResponse';
this.title = 'Upstream Server Failed';
this.message = 'Sorry pal, upstream servers failed us.';
this.resolution = 'You can try the search again at later time or head to the web instead.';
this.additionalInfo = additionalInfo;
this.requestType = 'serverError';
}
}
}