-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy patherrors.js
97 lines (89 loc) · 2.77 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const Terror = require('terror'),
errors = {};
/**
* @constructor
* @class LusterError
* @augments Terror
*/
const LusterError = errors.LusterError = Terror.create('LusterError',
{
ABSTRACT_METHOD_IS_NOT_IMPLEMENTED:
'Abstract method "%method%" is not implemented in the %klass%'
});
/**
* @constructor
* @class LusterWorkerError
* @augments LusterError
*/
errors.LusterWorkerError = LusterError.create('LusterWorkerError',
{
ALREADY_READY:
'Worker#ready() called when worker is is "ready" state already'
});
/**
* @constructor
* @class LusterConfigurationError
* @augments LusterError
*/
errors.LusterConfigurationError = LusterError.create('LusterConfigurationError',
{
CONFIGURATION_CHECK_FAILED:
'Configuration check failed',
PROP_REQUIRED:
'Required property "%property%" is absent',
PROP_TYPE_CHECK_FAILED:
'Property "%property%" type is "%type%", but %expected% is expected',
PROP_REGEXP_CHECK_FAILED:
'Property "%property%" doesn\'t meet the regexp "%regexp%"',
CAN_NOT_SET_ATOMIC_PROPERTY_FIELD:
'Property "%path%" already exists and is not an object'
});
/**
* @constructor
* @class LusterConfigurationError
* @augments LusterError
*/
errors.LusterWorkerWrapperError = LusterError.create('LusterWorkerWrapperError',
{
INVALID_ATTEMPT_TO_CHANGE_STATE:
'Invalid attempt to change worker #%wid% (pid: %pid%) state from "%state%" to "%targetState%"',
REMOTE_COMMAND_CALL_TO_STOPPED_WORKER:
'Remote command call "%command%" to stopped worker #%wid%'
});
/**
* @constructor
* @class LusterClusterProcessError
* @augments LusterError
*/
errors.LusterClusterProcessError = LusterError.create('LusterClusterProcessError',
{
REMOTE_COMMAND_ALREADY_REGISTERED:
'Command "%name%" already registered as allowed for remote calls',
REMOTE_COMMAND_IS_NOT_REGISTERED:
'Remote command "%name%" is not registered on %klass%',
EXTENSIONS_LOAD_TIMEOUT:
'Extensions %timeouted% not loaded in %timeout% ms'
});
/**
* @constructor
* @class LusterRPCCallbackError
* @augments LusterError
*/
errors.LusterRPCCallbackError = LusterError.create('LusterRPCCallbackError',
{
REMOTE_CALL_WITH_CALLBACK_TIMEOUT:
'Remote call failed due to timeout for command "%command%"'
});
/**
* @constructor
* @class LusterPortError
* @augments LusterError
*/
errors.LusterPortError = LusterError.create('LusterPortError',
{
NOT_UNIX_SOCKET:
'"%value%" is not a unix socket',
CAN_NOT_UNLINK_UNIX_SOCKET:
'Can not unlink unix socket "%socketPath%"'
});
module.exports = errors;