Skip to content

Commit 48cae76

Browse files
authored
Merge pull request #12 from thehobbit85/master
bug fixes
2 parents 8a094c3 + ad6284f commit 48cae76

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ results
1515
npm-debug.log
1616

1717
coverage
18+
node_modules

bin/stratum-notify

100644100755
File mode changed.

lib/client.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ module.exports = function (classes){
5252
});
5353

5454
if (isServer !== true) {
55-
self.socket.on('data', classes.curry.predefine(self.handleData, [self], self));
55+
self.socket.on('data', function clientSocketData(data) {
56+
classes.curry.predefine(self.handleData, [self], self)(data);
57+
});
5658
}
5759
},
5860
/**
@@ -75,7 +77,11 @@ module.exports = function (classes){
7577

7678
if (_.has(command, 'error') && (!_.isNull(command['error']) && !_.isEmpty(command['error']))) {
7779
// we have an error, we need to act on that, regardless of other members in the command received
78-
throw new Error(command);
80+
throw Object.assign(new Error(command.error[1]), {
81+
stratum_code: command.error[0],
82+
stack: command.error[2],
83+
id: command.id
84+
});
7985
} else if (_.has(command, 'id') && _.isNull(command['id'])) {
8086
// null id, it's a broadcast most likely, we need to check the last command
8187
if (_.has(command, 'method')) {

0 commit comments

Comments
 (0)