add emitters for "error" and "offline"#11
Open
wolfgangcolsman wants to merge 1 commit intomicroclimates:masterfrom
Open
add emitters for "error" and "offline"#11wolfgangcolsman wants to merge 1 commit intomicroclimates:masterfrom
wolfgangcolsman wants to merge 1 commit intomicroclimates:masterfrom
Conversation
Registering a listener on "error" allows addressing the following issue with onStatsInterval when the interval is triggered while end() is processing. If the "error" event is not handled, the process with exit.
...\node_modules\mqtt\lib\client.js:370
this.emit('error', new Error('client disconnecting'))
^
Error: client disconnecting
at MqttClient._checkDisconnecting (...\node_modules\mqtt\lib\client.js:370:26)
at MqttClient.publish (...\node_modules\mqtt\lib\client.js:408:12)
at module.exports.proto.onStatsInterval (...\node_modules\homie-device\lib\homieDevice.js:205:16)
at module.exports.proto.onConnect (...\node_modules\homie-device\lib\homieDevice.js:182:5)
at MqttClient.<anonymous> (...\node_modules\homie-device\lib\homieDevice.js:112:7)
at MqttClient.emit (events.js:201:15)
at MqttClient._handleConnack (...\node_modules\mqtt\lib\client.js:918:10)
at MqttClient._handlePacket (...\node_modules\mqtt\lib\client.js:350:12)
at work (...\node_modules\mqtt\lib\client.js:292:12)
at Writable.writable._write (...\node_modules\mqtt\lib\client.js:302:5)
at doWrite (...\node_modules\readable-stream\lib\_stream_writable.js:428:64)
at writeOrBuffer (...\node_modules\readable-stream\lib\_stream_writable.js:417:5)
at Writable.write (...\node_modules\readable-stream\lib\_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:696:22)
at Socket.emit (events.js:196:13)
at addChunk (_stream_readable.js:290:12)
at readableAddChunk (_stream_readable.js:271:11)
at Socket.Readable.push (_stream_readable.js:226:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registering a listener on "error" allows addressing the following issue with onStatsInterval when the interval is triggered while end() is processing. If the "error" event is not handled, the process with exit.
...\node_modules\mqtt\lib\client.js:370
this.emit('error', new Error('client disconnecting'))
^
Error: client disconnecting
at MqttClient._checkDisconnecting (...\node_modules\mqtt\lib\client.js:370:26)
at MqttClient.publish (...\node_modules\mqtt\lib\client.js:408:12)
at module.exports.proto.onStatsInterval (...\node_modules\homie-device\lib\homieDevice.js:205:16)
at module.exports.proto.onConnect (...\node_modules\homie-device\lib\homieDevice.js:182:5)
at MqttClient. (...\node_modules\homie-device\lib\homieDevice.js:112:7)
at MqttClient.emit (events.js:201:15)
at MqttClient._handleConnack (...\node_modules\mqtt\lib\client.js:918:10)
at MqttClient._handlePacket (...\node_modules\mqtt\lib\client.js:350:12)
at work (...\node_modules\mqtt\lib\client.js:292:12)
at Writable.writable._write (...\node_modules\mqtt\lib\client.js:302:5)
at doWrite (...\node_modules\readable-stream\lib_stream_writable.js:428:64)
at writeOrBuffer (...\node_modules\readable-stream\lib_stream_writable.js:417:5)
at Writable.write (...\node_modules\readable-stream\lib_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:696:22)
at Socket.emit (events.js:196:13)
at addChunk (_stream_readable.js:290:12)
at readableAddChunk (_stream_readable.js:271:11)
at Socket.Readable.push (_stream_readable.js:226:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)