(key, context)
| 280 | // and may have .path and .dest. |
| 281 | class SystemError extends Error { |
| 282 | constructor(key, context) { |
| 283 | super(); |
| 284 | const prefix = getMessage(key, [], this); |
| 285 | let message = `${prefix}: ${context.syscall} returned ` + |
| 286 | `${context.code} (${context.message})`; |
| 287 | |
| 288 | if (context.path !== undefined) |
| 289 | message += ` ${context.path}`; |
| 290 | if (context.dest !== undefined) |
| 291 | message += ` => ${context.dest}`; |
| 292 | |
| 293 | this.code = key; |
| 294 | |
| 295 | ObjectDefineProperties(this, { |
| 296 | [kIsNodeError]: { |
| 297 | __proto__: null, |
| 298 | value: true, |
| 299 | enumerable: false, |
| 300 | writable: false, |
| 301 | configurable: true, |
| 302 | }, |
| 303 | name: { |
| 304 | __proto__: null, |
| 305 | value: 'SystemError', |
| 306 | enumerable: false, |
| 307 | writable: true, |
| 308 | configurable: true, |
| 309 | }, |
| 310 | message: { |
| 311 | __proto__: null, |
| 312 | value: message, |
| 313 | enumerable: false, |
| 314 | writable: true, |
| 315 | configurable: true, |
| 316 | }, |
| 317 | info: { |
| 318 | __proto__: null, |
| 319 | value: context, |
| 320 | enumerable: true, |
| 321 | configurable: true, |
| 322 | writable: false, |
| 323 | }, |
| 324 | errno: { |
| 325 | __proto__: null, |
| 326 | get() { |
| 327 | return context.errno; |
| 328 | }, |
| 329 | set: (value) => { |
| 330 | context.errno = value; |
| 331 | }, |
| 332 | enumerable: true, |
| 333 | configurable: true, |
| 334 | }, |
| 335 | syscall: { |
| 336 | __proto__: null, |
| 337 | get() { |
| 338 | return context.syscall; |
| 339 | }, |
nothing calls this directly
no test coverage detected