Skip to content

Commit ad6284f

Browse files
committed
now throws a correct stratum error
1 parent e755c13 commit ad6284f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/stratum-notify

100644100755
File mode changed.

lib/client.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ module.exports = function (classes){
7777

7878
if (_.has(command, 'error') && (!_.isNull(command['error']) && !_.isEmpty(command['error']))) {
7979
// we have an error, we need to act on that, regardless of other members in the command received
80-
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+
});
8185
} else if (_.has(command, 'id') && _.isNull(command['id'])) {
8286
// null id, it's a broadcast most likely, we need to check the last command
8387
if (_.has(command, 'method')) {

0 commit comments

Comments
 (0)