This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
/
errors.js
67 lines (55 loc) · 1.73 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict'
class NotInitializedError extends Error {
constructor (message = 'not initialized') {
super(message)
this.name = 'NotInitializedError'
this.code = NotInitializedError.code
}
}
NotInitializedError.code = 'ERR_NOT_INITIALIZED'
exports.NotInitializedError = NotInitializedError
class AlreadyInitializingError extends Error {
constructor (message = 'cannot initialize an initializing node') {
super(message)
this.name = 'AlreadyInitializingError'
this.code = AlreadyInitializedError.code
}
}
AlreadyInitializingError.code = 'ERR_ALREADY_INITIALIZING'
exports.AlreadyInitializingError = AlreadyInitializingError
class AlreadyInitializedError extends Error {
constructor (message = 'cannot re-initialize an initialized node') {
super(message)
this.name = 'AlreadyInitializedError'
this.code = AlreadyInitializedError.code
}
}
AlreadyInitializedError.code = 'ERR_ALREADY_INITIALIZED'
exports.AlreadyInitializedError = AlreadyInitializedError
class NotStartedError extends Error {
constructor (message = 'not started') {
super(message)
this.name = 'NotStartedError'
this.code = NotStartedError.code
}
}
NotStartedError.code = 'ERR_NOT_STARTED'
exports.NotStartedError = NotStartedError
class NotEnabledError extends Error {
constructor (message = 'not enabled') {
super(message)
this.name = 'NotEnabledError'
this.code = NotEnabledError.code
}
}
NotEnabledError.code = 'ERR_NOT_ENABLED'
exports.NotEnabledError = NotEnabledError
class TimeoutError extends Error {
constructor (message = 'request timed out') {
super(message)
this.name = 'TimeoutError'
this.code = TimeoutError.code
}
}
TimeoutError.code = 'ERR_TIMEOUT'
exports.TimeoutError = TimeoutError