Skip to content

Commit

Permalink
fix(client-core): Rejects command promises if client is not in ready …
Browse files Browse the repository at this point in the history
…state. Prevents unresolved promises, memory leaks, and helps the object consuming the client maintain flow in case of errors.
  • Loading branch information
jesperstarkar committed Aug 22, 2017
1 parent d98690c commit 4949ac5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/modbus-client-core.js
Expand Up @@ -181,6 +181,7 @@ module.exports = stampit()
if (this.inState('closed')) {
this.emit('error', 'connection closed')
}
defer.reject({err: 'modbus client not in "ready" state'})
}
}

Expand Down

0 comments on commit 4949ac5

Please sign in to comment.