@zenfs/core 0.7.10 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,86 +2,168 @@
2
2
  /**
3
3
  * Standard libc error codes. More will be added to this enum and ErrorStrings as they are
4
4
  * needed.
5
- * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
5
+ * @url https://en.wikipedia.org/wiki/Errno.h
6
6
  */
7
7
  export declare enum ErrorCode {
8
- /**
9
- * Operation not permitted
10
- */
8
+ /** Operation not permitted */
11
9
  EPERM = 1,
12
- /**
13
- * No such file or directory
14
- */
10
+ /** No such file or directory */
15
11
  ENOENT = 2,
16
- /**
17
- * Input/output error
18
- */
12
+ /** Input/output error */
19
13
  EIO = 5,
20
- /**
21
- * Bad file descriptor
22
- */
14
+ /** No such device or address */
15
+ ENXIO = 6,
16
+ /** Bad file descriptor */
23
17
  EBADF = 9,
24
- /**
25
- * Permission denied
26
- */
18
+ /** Resource temporarily unavailable */
19
+ EAGAIN = 11,
20
+ /** Cannot allocate memory */
21
+ ENOMEM = 12,
22
+ /** Permission denied */
27
23
  EACCES = 13,
28
- /**
29
- * Resource busy or locked
30
- */
24
+ /** Bad address */
25
+ EFAULT = 14,
26
+ /** Block device required */
27
+ ENOTBLK = 15,
28
+ /** Resource busy or locked */
31
29
  EBUSY = 16,
32
- /**
33
- * File exists
34
- */
30
+ /** File exists */
35
31
  EEXIST = 17,
36
- /**
37
- * File is not a directory
38
- */
32
+ /** Invalid cross-device link */
33
+ EXDEV = 18,
34
+ /** No such device */
35
+ ENODEV = 19,
36
+ /** File is not a directory */
39
37
  ENOTDIR = 20,
40
- /**
41
- * File is a directory
42
- */
38
+ /** File is a directory */
43
39
  EISDIR = 21,
44
- /**
45
- * Invalid argument
46
- */
40
+ /** Invalid argument */
47
41
  EINVAL = 22,
48
- /**
49
- * File is too big
50
- */
42
+ /** Too many open files in system */
43
+ ENFILE = 23,
44
+ /** Too many open files */
45
+ EMFILE = 24,
46
+ /** Text file busy */
47
+ ETXTBSY = 26,
48
+ /** File is too big */
51
49
  EFBIG = 27,
52
- /**
53
- * No space left on disk
54
- */
50
+ /** No space left on disk */
55
51
  ENOSPC = 28,
56
- /**
57
- * Cannot modify a read-only file system
58
- */
52
+ /** Illegal seek */
53
+ ESPIPE = 29,
54
+ /** Cannot modify a read-only file system */
59
55
  EROFS = 30,
60
- /**
61
- * Resource deadlock would occur
62
- */
56
+ /** Too many links */
57
+ EMLINK = 31,
58
+ /** Broken pipe */
59
+ EPIPE = 32,
60
+ /** Numerical argument out of domain */
61
+ EDOM = 33,
62
+ /** Numerical result out of range */
63
+ ERANGE = 34,
64
+ /** Resource deadlock would occur */
63
65
  EDEADLK = 35,
64
- /**
65
- * Directory is not empty
66
- */
66
+ /** File name too long */
67
+ ENAMETOOLONG = 36,
68
+ /** No locks available */
69
+ ENOLCK = 37,
70
+ /** Function not implemented */
71
+ ENOSYS = 38,
72
+ /** Directory is not empty */
67
73
  ENOTEMPTY = 39,
68
- /**
69
- * Operation is not supported
70
- */
71
- ENOTSUP = 95
74
+ /** Too many levels of symbolic links */
75
+ ELOOP = 40,
76
+ /** No message of desired type */
77
+ ENOMSG = 42,
78
+ /** Invalid exchange */
79
+ EBADE = 52,
80
+ /** Invalid request descriptor */
81
+ EBADR = 53,
82
+ /** Exchange full */
83
+ EXFULL = 54,
84
+ /** No anode */
85
+ ENOANO = 55,
86
+ /** Invalid request code */
87
+ EBADRQC = 56,
88
+ /** Device not a stream */
89
+ ENOSTR = 60,
90
+ /** No data available */
91
+ ENODATA = 61,
92
+ /** Timer expired */
93
+ ETIME = 62,
94
+ /** Out of streams resources */
95
+ ENOSR = 63,
96
+ /** Machine is not on the network */
97
+ ENONET = 64,
98
+ /** Object is remote */
99
+ EREMOTE = 66,
100
+ /** Link has been severed */
101
+ ENOLINK = 67,
102
+ /** Communication error on send */
103
+ ECOMM = 70,
104
+ /** Protocol error */
105
+ EPROTO = 71,
106
+ /** Bad message */
107
+ EBADMSG = 74,
108
+ /** Value too large for defined data type */
109
+ EOVERFLOW = 75,
110
+ /** File descriptor in bad state */
111
+ EBADFD = 77,
112
+ /** Streams pipe error */
113
+ ESTRPIPE = 86,
114
+ /** Socket operation on non-socket */
115
+ ENOTSOCK = 88,
116
+ /** Destination address required */
117
+ EDESTADDRREQ = 89,
118
+ /** Message too long */
119
+ EMSGSIZE = 90,
120
+ /** Protocol wrong type for socket */
121
+ EPROTOTYPE = 91,
122
+ /** Protocol not available */
123
+ ENOPROTOOPT = 92,
124
+ /** Protocol not supported */
125
+ EPROTONOSUPPORT = 93,
126
+ /** Socket type not supported */
127
+ ESOCKTNOSUPPORT = 94,
128
+ /** Operation is not supported */
129
+ ENOTSUP = 95,
130
+ /** Network is down */
131
+ ENETDOWN = 100,
132
+ /** Network is unreachable */
133
+ ENETUNREACH = 101,
134
+ /** Network dropped connection on reset */
135
+ ENETRESET = 102,
136
+ /** Connection timed out */
137
+ ETIMEDOUT = 110,
138
+ /** Connection refused */
139
+ ECONNREFUSED = 111,
140
+ /** Host is down */
141
+ EHOSTDOWN = 112,
142
+ /** No route to host */
143
+ EHOSTUNREACH = 113,
144
+ /** Operation already in progress */
145
+ EALREADY = 114,
146
+ /** Operation now in progress */
147
+ EINPROGRESS = 115,
148
+ /** Stale file handle */
149
+ ESTALE = 116,
150
+ /** Remote I/O error */
151
+ EREMOTEIO = 121,
152
+ /** Disk quota exceeded */
153
+ EDQUOT = 122
72
154
  }
73
155
  /**
74
156
  * Strings associated with each error code.
75
157
  * @internal
76
158
  */
77
- export declare const ErrorStrings: {
78
- [code in ErrorCode]: string;
159
+ export declare const errorMessages: {
160
+ [K in ErrorCode]: string;
79
161
  };
80
162
  interface ApiErrorJSON {
81
163
  errno: ErrorCode;
82
164
  message: string;
83
165
  path?: string;
84
- code: string;
166
+ code: keyof typeof ErrorCode;
85
167
  stack: string;
86
168
  syscall: string;
87
169
  }
@@ -94,8 +176,8 @@ export declare class ApiError extends Error implements NodeJS.ErrnoException {
94
176
  path?: string;
95
177
  syscall: string;
96
178
  static fromJSON(json: ApiErrorJSON): ApiError;
97
- static With(code: string, path: string, syscall?: string): ApiError;
98
- code: string;
179
+ static With(code: keyof typeof ErrorCode, path: string, syscall?: string): ApiError;
180
+ code: keyof typeof ErrorCode;
99
181
  /**
100
182
  * Represents a ZenFS error. Passed back to applications after a failed
101
183
  * call to the ZenFS API.
package/dist/ApiError.js CHANGED
@@ -1,96 +1,235 @@
1
1
  /**
2
2
  * Standard libc error codes. More will be added to this enum and ErrorStrings as they are
3
3
  * needed.
4
- * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
4
+ * @url https://en.wikipedia.org/wiki/Errno.h
5
5
  */
6
6
  export var ErrorCode;
7
7
  (function (ErrorCode) {
8
- /**
9
- * Operation not permitted
10
- */
8
+ /** Operation not permitted */
11
9
  ErrorCode[ErrorCode["EPERM"] = 1] = "EPERM";
12
- /**
13
- * No such file or directory
14
- */
10
+ /** No such file or directory */
15
11
  ErrorCode[ErrorCode["ENOENT"] = 2] = "ENOENT";
16
- /**
17
- * Input/output error
18
- */
12
+ /** Input/output error */
19
13
  ErrorCode[ErrorCode["EIO"] = 5] = "EIO";
20
- /**
21
- * Bad file descriptor
22
- */
14
+ /** No such device or address */
15
+ ErrorCode[ErrorCode["ENXIO"] = 6] = "ENXIO";
16
+ /** Bad file descriptor */
23
17
  ErrorCode[ErrorCode["EBADF"] = 9] = "EBADF";
24
- /**
25
- * Permission denied
26
- */
18
+ /** Resource temporarily unavailable */
19
+ ErrorCode[ErrorCode["EAGAIN"] = 11] = "EAGAIN";
20
+ /** Cannot allocate memory */
21
+ ErrorCode[ErrorCode["ENOMEM"] = 12] = "ENOMEM";
22
+ /** Permission denied */
27
23
  ErrorCode[ErrorCode["EACCES"] = 13] = "EACCES";
28
- /**
29
- * Resource busy or locked
30
- */
24
+ /** Bad address */
25
+ ErrorCode[ErrorCode["EFAULT"] = 14] = "EFAULT";
26
+ /** Block device required */
27
+ ErrorCode[ErrorCode["ENOTBLK"] = 15] = "ENOTBLK";
28
+ /** Resource busy or locked */
31
29
  ErrorCode[ErrorCode["EBUSY"] = 16] = "EBUSY";
32
- /**
33
- * File exists
34
- */
30
+ /** File exists */
35
31
  ErrorCode[ErrorCode["EEXIST"] = 17] = "EEXIST";
36
- /**
37
- * File is not a directory
38
- */
32
+ /** Invalid cross-device link */
33
+ ErrorCode[ErrorCode["EXDEV"] = 18] = "EXDEV";
34
+ /** No such device */
35
+ ErrorCode[ErrorCode["ENODEV"] = 19] = "ENODEV";
36
+ /** File is not a directory */
39
37
  ErrorCode[ErrorCode["ENOTDIR"] = 20] = "ENOTDIR";
40
- /**
41
- * File is a directory
42
- */
38
+ /** File is a directory */
43
39
  ErrorCode[ErrorCode["EISDIR"] = 21] = "EISDIR";
44
- /**
45
- * Invalid argument
46
- */
40
+ /** Invalid argument */
47
41
  ErrorCode[ErrorCode["EINVAL"] = 22] = "EINVAL";
48
- /**
49
- * File is too big
50
- */
42
+ /** Too many open files in system */
43
+ ErrorCode[ErrorCode["ENFILE"] = 23] = "ENFILE";
44
+ /** Too many open files */
45
+ ErrorCode[ErrorCode["EMFILE"] = 24] = "EMFILE";
46
+ /** Text file busy */
47
+ ErrorCode[ErrorCode["ETXTBSY"] = 26] = "ETXTBSY";
48
+ /** File is too big */
51
49
  ErrorCode[ErrorCode["EFBIG"] = 27] = "EFBIG";
52
- /**
53
- * No space left on disk
54
- */
50
+ /** No space left on disk */
55
51
  ErrorCode[ErrorCode["ENOSPC"] = 28] = "ENOSPC";
56
- /**
57
- * Cannot modify a read-only file system
58
- */
52
+ /** Illegal seek */
53
+ ErrorCode[ErrorCode["ESPIPE"] = 29] = "ESPIPE";
54
+ /** Cannot modify a read-only file system */
59
55
  ErrorCode[ErrorCode["EROFS"] = 30] = "EROFS";
60
- /**
61
- * Resource deadlock would occur
62
- */
56
+ /** Too many links */
57
+ ErrorCode[ErrorCode["EMLINK"] = 31] = "EMLINK";
58
+ /** Broken pipe */
59
+ ErrorCode[ErrorCode["EPIPE"] = 32] = "EPIPE";
60
+ /** Numerical argument out of domain */
61
+ ErrorCode[ErrorCode["EDOM"] = 33] = "EDOM";
62
+ /** Numerical result out of range */
63
+ ErrorCode[ErrorCode["ERANGE"] = 34] = "ERANGE";
64
+ /** Resource deadlock would occur */
63
65
  ErrorCode[ErrorCode["EDEADLK"] = 35] = "EDEADLK";
64
- /**
65
- * Directory is not empty
66
- */
66
+ /** File name too long */
67
+ ErrorCode[ErrorCode["ENAMETOOLONG"] = 36] = "ENAMETOOLONG";
68
+ /** No locks available */
69
+ ErrorCode[ErrorCode["ENOLCK"] = 37] = "ENOLCK";
70
+ /** Function not implemented */
71
+ ErrorCode[ErrorCode["ENOSYS"] = 38] = "ENOSYS";
72
+ /** Directory is not empty */
67
73
  ErrorCode[ErrorCode["ENOTEMPTY"] = 39] = "ENOTEMPTY";
68
- /**
69
- * Operation is not supported
70
- */
74
+ /** Too many levels of symbolic links */
75
+ ErrorCode[ErrorCode["ELOOP"] = 40] = "ELOOP";
76
+ /** No message of desired type */
77
+ ErrorCode[ErrorCode["ENOMSG"] = 42] = "ENOMSG";
78
+ /** Invalid exchange */
79
+ ErrorCode[ErrorCode["EBADE"] = 52] = "EBADE";
80
+ /** Invalid request descriptor */
81
+ ErrorCode[ErrorCode["EBADR"] = 53] = "EBADR";
82
+ /** Exchange full */
83
+ ErrorCode[ErrorCode["EXFULL"] = 54] = "EXFULL";
84
+ /** No anode */
85
+ ErrorCode[ErrorCode["ENOANO"] = 55] = "ENOANO";
86
+ /** Invalid request code */
87
+ ErrorCode[ErrorCode["EBADRQC"] = 56] = "EBADRQC";
88
+ /** Device not a stream */
89
+ ErrorCode[ErrorCode["ENOSTR"] = 60] = "ENOSTR";
90
+ /** No data available */
91
+ ErrorCode[ErrorCode["ENODATA"] = 61] = "ENODATA";
92
+ /** Timer expired */
93
+ ErrorCode[ErrorCode["ETIME"] = 62] = "ETIME";
94
+ /** Out of streams resources */
95
+ ErrorCode[ErrorCode["ENOSR"] = 63] = "ENOSR";
96
+ /** Machine is not on the network */
97
+ ErrorCode[ErrorCode["ENONET"] = 64] = "ENONET";
98
+ /** Object is remote */
99
+ ErrorCode[ErrorCode["EREMOTE"] = 66] = "EREMOTE";
100
+ /** Link has been severed */
101
+ ErrorCode[ErrorCode["ENOLINK"] = 67] = "ENOLINK";
102
+ /** Communication error on send */
103
+ ErrorCode[ErrorCode["ECOMM"] = 70] = "ECOMM";
104
+ /** Protocol error */
105
+ ErrorCode[ErrorCode["EPROTO"] = 71] = "EPROTO";
106
+ /** Bad message */
107
+ ErrorCode[ErrorCode["EBADMSG"] = 74] = "EBADMSG";
108
+ /** Value too large for defined data type */
109
+ ErrorCode[ErrorCode["EOVERFLOW"] = 75] = "EOVERFLOW";
110
+ /** File descriptor in bad state */
111
+ ErrorCode[ErrorCode["EBADFD"] = 77] = "EBADFD";
112
+ /** Streams pipe error */
113
+ ErrorCode[ErrorCode["ESTRPIPE"] = 86] = "ESTRPIPE";
114
+ /** Socket operation on non-socket */
115
+ ErrorCode[ErrorCode["ENOTSOCK"] = 88] = "ENOTSOCK";
116
+ /** Destination address required */
117
+ ErrorCode[ErrorCode["EDESTADDRREQ"] = 89] = "EDESTADDRREQ";
118
+ /** Message too long */
119
+ ErrorCode[ErrorCode["EMSGSIZE"] = 90] = "EMSGSIZE";
120
+ /** Protocol wrong type for socket */
121
+ ErrorCode[ErrorCode["EPROTOTYPE"] = 91] = "EPROTOTYPE";
122
+ /** Protocol not available */
123
+ ErrorCode[ErrorCode["ENOPROTOOPT"] = 92] = "ENOPROTOOPT";
124
+ /** Protocol not supported */
125
+ ErrorCode[ErrorCode["EPROTONOSUPPORT"] = 93] = "EPROTONOSUPPORT";
126
+ /** Socket type not supported */
127
+ ErrorCode[ErrorCode["ESOCKTNOSUPPORT"] = 94] = "ESOCKTNOSUPPORT";
128
+ /** Operation is not supported */
71
129
  ErrorCode[ErrorCode["ENOTSUP"] = 95] = "ENOTSUP";
130
+ /** Network is down */
131
+ ErrorCode[ErrorCode["ENETDOWN"] = 100] = "ENETDOWN";
132
+ /** Network is unreachable */
133
+ ErrorCode[ErrorCode["ENETUNREACH"] = 101] = "ENETUNREACH";
134
+ /** Network dropped connection on reset */
135
+ ErrorCode[ErrorCode["ENETRESET"] = 102] = "ENETRESET";
136
+ /** Connection timed out */
137
+ ErrorCode[ErrorCode["ETIMEDOUT"] = 110] = "ETIMEDOUT";
138
+ /** Connection refused */
139
+ ErrorCode[ErrorCode["ECONNREFUSED"] = 111] = "ECONNREFUSED";
140
+ /** Host is down */
141
+ ErrorCode[ErrorCode["EHOSTDOWN"] = 112] = "EHOSTDOWN";
142
+ /** No route to host */
143
+ ErrorCode[ErrorCode["EHOSTUNREACH"] = 113] = "EHOSTUNREACH";
144
+ /** Operation already in progress */
145
+ ErrorCode[ErrorCode["EALREADY"] = 114] = "EALREADY";
146
+ /** Operation now in progress */
147
+ ErrorCode[ErrorCode["EINPROGRESS"] = 115] = "EINPROGRESS";
148
+ /** Stale file handle */
149
+ ErrorCode[ErrorCode["ESTALE"] = 116] = "ESTALE";
150
+ /** Remote I/O error */
151
+ ErrorCode[ErrorCode["EREMOTEIO"] = 121] = "EREMOTEIO";
152
+ /** Disk quota exceeded */
153
+ ErrorCode[ErrorCode["EDQUOT"] = 122] = "EDQUOT";
72
154
  })(ErrorCode = ErrorCode || (ErrorCode = {}));
73
155
  /**
74
156
  * Strings associated with each error code.
75
157
  * @internal
76
158
  */
77
- export const ErrorStrings = {
78
- [ErrorCode.EPERM]: 'Operation not permitted.',
79
- [ErrorCode.ENOENT]: 'No such file or directory.',
80
- [ErrorCode.EIO]: 'Input/output error.',
81
- [ErrorCode.EBADF]: 'Bad file descriptor.',
82
- [ErrorCode.EACCES]: 'Permission denied.',
83
- [ErrorCode.EBUSY]: 'Resource busy or locked.',
84
- [ErrorCode.EEXIST]: 'File exists.',
85
- [ErrorCode.ENOTDIR]: 'File is not a directory.',
86
- [ErrorCode.EISDIR]: 'File is a directory.',
87
- [ErrorCode.EINVAL]: 'Invalid argument.',
88
- [ErrorCode.EFBIG]: 'File is too big.',
89
- [ErrorCode.ENOSPC]: 'No space left on disk.',
90
- [ErrorCode.EROFS]: 'Cannot modify a read-only file system.',
159
+ export const errorMessages = {
160
+ [ErrorCode.EPERM]: 'Operation not permitted',
161
+ [ErrorCode.ENOENT]: 'No such file or directory',
162
+ [ErrorCode.EIO]: 'Input/output error',
163
+ [ErrorCode.ENXIO]: 'No such device or address',
164
+ [ErrorCode.EBADF]: 'Bad file descriptor',
165
+ [ErrorCode.EAGAIN]: 'Resource temporarily unavailable',
166
+ [ErrorCode.ENOMEM]: 'Cannot allocate memory',
167
+ [ErrorCode.EACCES]: 'Permission denied',
168
+ [ErrorCode.EFAULT]: 'Bad address',
169
+ [ErrorCode.ENOTBLK]: 'Block device required',
170
+ [ErrorCode.EBUSY]: 'Resource busy or locked',
171
+ [ErrorCode.EEXIST]: 'File exists',
172
+ [ErrorCode.EXDEV]: 'Invalid cross-device link',
173
+ [ErrorCode.ENODEV]: 'No such device',
174
+ [ErrorCode.ENOTDIR]: 'File is not a directory',
175
+ [ErrorCode.EISDIR]: 'File is a directory',
176
+ [ErrorCode.EINVAL]: 'Invalid argument',
177
+ [ErrorCode.ENFILE]: 'Too many open files in system',
178
+ [ErrorCode.EMFILE]: 'Too many open files',
179
+ [ErrorCode.ETXTBSY]: 'Text file busy',
180
+ [ErrorCode.EFBIG]: 'File is too big',
181
+ [ErrorCode.ENOSPC]: 'No space left on disk',
182
+ [ErrorCode.ESPIPE]: 'Illegal seek',
183
+ [ErrorCode.EROFS]: 'Cannot modify a read-only file system',
184
+ [ErrorCode.EMLINK]: 'Too many links',
185
+ [ErrorCode.EPIPE]: 'Broken pipe',
186
+ [ErrorCode.EDOM]: 'Numerical argument out of domain',
187
+ [ErrorCode.ERANGE]: 'Numerical result out of range',
91
188
  [ErrorCode.EDEADLK]: 'Resource deadlock would occur',
92
- [ErrorCode.ENOTEMPTY]: 'Directory is not empty.',
93
- [ErrorCode.ENOTSUP]: 'Operation is not supported.',
189
+ [ErrorCode.ENAMETOOLONG]: 'File name too long',
190
+ [ErrorCode.ENOLCK]: 'No locks available',
191
+ [ErrorCode.ENOSYS]: 'Function not implemented',
192
+ [ErrorCode.ENOTEMPTY]: 'Directory is not empty',
193
+ [ErrorCode.ELOOP]: 'Too many levels of symbolic links',
194
+ [ErrorCode.ENOMSG]: 'No message of desired type',
195
+ [ErrorCode.EBADE]: 'Invalid exchange',
196
+ [ErrorCode.EBADR]: 'Invalid request descriptor',
197
+ [ErrorCode.EXFULL]: 'Exchange full',
198
+ [ErrorCode.ENOANO]: 'No anode',
199
+ [ErrorCode.EBADRQC]: 'Invalid request code',
200
+ [ErrorCode.ENOSTR]: 'Device not a stream',
201
+ [ErrorCode.ENODATA]: 'No data available',
202
+ [ErrorCode.ETIME]: 'Timer expired',
203
+ [ErrorCode.ENOSR]: 'Out of streams resources',
204
+ [ErrorCode.ENONET]: 'Machine is not on the network',
205
+ [ErrorCode.EREMOTE]: 'Object is remote',
206
+ [ErrorCode.ENOLINK]: 'Link has been severed',
207
+ [ErrorCode.ECOMM]: 'Communication error on send',
208
+ [ErrorCode.EPROTO]: 'Protocol error',
209
+ [ErrorCode.EBADMSG]: 'Bad message',
210
+ [ErrorCode.EOVERFLOW]: 'Value too large for defined data type',
211
+ [ErrorCode.EBADFD]: 'File descriptor in bad state',
212
+ [ErrorCode.ESTRPIPE]: 'Streams pipe error',
213
+ [ErrorCode.ENOTSOCK]: 'Socket operation on non-socket',
214
+ [ErrorCode.EDESTADDRREQ]: 'Destination address required',
215
+ [ErrorCode.EMSGSIZE]: 'Message too long',
216
+ [ErrorCode.EPROTOTYPE]: 'Protocol wrong type for socket',
217
+ [ErrorCode.ENOPROTOOPT]: 'Protocol not available',
218
+ [ErrorCode.EPROTONOSUPPORT]: 'Protocol not supported',
219
+ [ErrorCode.ESOCKTNOSUPPORT]: 'Socket type not supported',
220
+ [ErrorCode.ENOTSUP]: 'Operation is not supported',
221
+ [ErrorCode.ENETDOWN]: 'Network is down',
222
+ [ErrorCode.ENETUNREACH]: 'Network is unreachable',
223
+ [ErrorCode.ENETRESET]: 'Network dropped connection on reset',
224
+ [ErrorCode.ETIMEDOUT]: 'Connection timed out',
225
+ [ErrorCode.ECONNREFUSED]: 'Connection refused',
226
+ [ErrorCode.EHOSTDOWN]: 'Host is down',
227
+ [ErrorCode.EHOSTUNREACH]: 'No route to host',
228
+ [ErrorCode.EALREADY]: 'Operation already in progress',
229
+ [ErrorCode.EINPROGRESS]: 'Operation now in progress',
230
+ [ErrorCode.ESTALE]: 'Stale file handle',
231
+ [ErrorCode.EREMOTEIO]: 'Remote I/O error',
232
+ [ErrorCode.EDQUOT]: 'Disk quota exceeded',
94
233
  };
95
234
  /**
96
235
  * Represents a ZenFS error. Passed back to applications after a failed
@@ -104,7 +243,7 @@ export class ApiError extends Error {
104
243
  return err;
105
244
  }
106
245
  static With(code, path, syscall) {
107
- return new ApiError(ErrorCode[code], ErrorStrings[ErrorCode[code]], path, syscall);
246
+ return new ApiError(ErrorCode[code], errorMessages[ErrorCode[code]], path, syscall);
108
247
  }
109
248
  /**
110
249
  * Represents a ZenFS error. Passed back to applications after a failed
@@ -116,7 +255,7 @@ export class ApiError extends Error {
116
255
  * @param type The type of the error.
117
256
  * @param message A descriptive error message.
118
257
  */
119
- constructor(errno, message = ErrorStrings[errno], path, syscall = '') {
258
+ constructor(errno, message = errorMessages[errno], path, syscall = '') {
120
259
  super(message);
121
260
  this.errno = errno;
122
261
  this.path = path;