-
Notifications
You must be signed in to change notification settings - Fork 4
/
errors.ts
96 lines (84 loc) · 2.85 KB
/
errors.ts
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
import ErrorPolykey from './ErrorPolykey';
import sysexits from './utils/sysexits';
class ErrorPolykeyUnimplemented<T> extends ErrorPolykey<T> {
static description = 'This is an unimplemented functionality';
exitCode = sysexits.UNAVAILABLE;
}
class ErrorPolykeyUnknown<T> extends ErrorPolykey<T> {
static description = 'Unable to deserialise to known error';
exitCode = sysexits.PROTOCOL;
}
class ErrorPolykeyAgentRunning<T> extends ErrorPolykey<T> {
static description = 'PolykeyAgent is running';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyAgentNotRunning<T> extends ErrorPolykey<T> {
static description = 'PolykeyAgent is not running';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyAgentDestroyed<T> extends ErrorPolykey<T> {
static description = 'PolykeyAgent is destroyed';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyClientRunning<T> extends ErrorPolykey<T> {
static description = 'PolykeyClient is running';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyClientNotRunning<T> extends ErrorPolykey<T> {
static description = 'PolykeyClient is not running';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyClientDestroyed<T> extends ErrorPolykey<T> {
static description = 'PolykeyClient is destroyed';
exitCode = sysexits.USAGE;
}
class ErrorPolykeyClientCreateTimeout<T> extends ErrorPolykey<T> {
static description = 'PolykeyClient create timeout';
exitCode = sysexits.UNAVAILABLE;
}
class ErrorPolykeyClientNodeIdInvalid<T> extends ErrorPolykey<T> {
static description = 'PolykeyClient failed parsing encoded node ID';
exitCode = sysexits.USAGE;
}
export {
sysexits,
ErrorPolykey,
ErrorPolykeyUnimplemented,
ErrorPolykeyUnknown,
ErrorPolykeyAgentRunning,
ErrorPolykeyAgentNotRunning,
ErrorPolykeyAgentDestroyed,
ErrorPolykeyClientRunning,
ErrorPolykeyClientNotRunning,
ErrorPolykeyClientDestroyed,
ErrorPolykeyClientCreateTimeout,
ErrorPolykeyClientNodeIdInvalid,
};
/**
* Recursively export all domain-level error classes
* This ensures that we have one place to construct and
* reference all Polykey errors.
* This is used by RPC to serialize errors from agent to client.
*/
export * from './audit/errors';
export * from './sessions/errors';
export * from './keys/errors';
export * from './vaults/errors';
export * from './git/errors';
export * from './discovery/errors';
export * from './gestalts/errors';
export * from './identities/errors';
export * from './client/errors';
export * from './network/errors';
export * from './nodes/errors';
export * from './claims/errors';
export * from './sigchain/errors';
export * from './bootstrap/errors';
export * from './notifications/errors';
export * from './schema/errors';
export * from './status/errors';
export * from './tasks/errors';
export * from './tokens/errors';
export * from './validation/errors';
export * from './utils/errors';
export * from './workers/errors';