-
Notifications
You must be signed in to change notification settings - Fork 82
/
error-codes.d.ts
67 lines (66 loc) · 1.63 KB
/
error-codes.d.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
/**
* This is a list of error codes that can be thrown from enigma.js API calls.
* @entry
* @see EnigmaError
* @enum
* @example <caption>Handling an enigma.js error</caption>
* const { NOT_CONNECTED } = require('enigma.js/error-codes');
* try {
* const layout = await model.getLayout();
* } catch (err) {
* if (err.code === NOT_CONNECTED) {
* console.log('Tried to communicate on a session that is closed');
* }
* }
*/
declare const errorCodes: {
/**
* You're trying to send data on a socket that's not connected.
*/
NOT_CONNECTED: number;
/**
* The object you're trying to fetch does not exist.
*/
OBJECT_NOT_FOUND: number;
/**
* Unexpected RPC response, expected array of patches.
*/
EXPECTED_ARRAY_OF_PATCHES: number;
/**
* Not an object that can be patched.
*/
PATCH_HAS_NO_PARENT: number;
/**
* This entry is already defined with another key.
*/
ENTRY_ALREADY_DEFINED: number;
/**
* You need to supply a configuration.
*/
NO_CONFIG_SUPPLIED: number;
/**
* There's no promise object available (polyfill required?).
*/
PROMISE_REQUIRED: number;
/**
* The schema struct type you requested does not exist.
*/
SCHEMA_STRUCT_TYPE_NOT_FOUND: number;
/**
* Can't override this function.
*/
SCHEMA_MIXIN_CANT_OVERRIDE_FUNCTION: number;
/**
* Extend is not allowed for this mixin.
*/
SCHEMA_MIXIN_EXTEND_NOT_ALLOWED: number;
/**
* Session suspended - no interaction allowed.
*/
SESSION_SUSPENDED: number;
/**
* onlyIfAttached supplied, but you got SESSION_CREATED.
*/
SESSION_NOT_ATTACHED: number;
};
export default errorCodes;