Skip to content

Commit 20167fe

Browse files
Bougarfaoui El houcinerefack
authored andcommitted
errors: migrate socket_list to internal/errors
1 parent 01eddd9 commit 20167fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/internal/errors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ E('ERR_UNKNOWN_STREAM_TYPE', 'Unknown stream file type');
177177
E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' +
178178
'See https://github.com/nodejs/node/wiki/Intl');
179179
// Add new errors from here...
180+
E('ERR_SLAVE_CLOSED_BEFORE_REPLY','Slave closed before reply');
180181

181182
function invalidArgType(name, expected, actual) {
182183
assert(name, 'name is required');

lib/internal/socket_list.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
const errors = require('internal/errors');
4+
35
const EventEmitter = require('events');
46

57
// This object keeps track of the sockets that are sent
@@ -18,7 +20,7 @@ class SocketListSend extends EventEmitter {
1820

1921
function onclose() {
2022
self.child.removeListener('internalMessage', onreply);
21-
callback(new Error('child closed before reply'));
23+
callback(new errors.Error('ERR_SLAVE_CLOSED_BEFORE_REPLY'));
2224
}
2325

2426
function onreply(msg) {

0 commit comments

Comments
 (0)