You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For many kinds of error all you get is a close event - the error event is not emitted so you have no idea what the problem is.
Adding DEBUG=mqttjs:* shows the following:
mqttjs:client _writePacket :: emitting `packetsend`
mqttjs:client _writePacket :: writing to stream
mqttjs:client _writePacket :: writeToStream result false
mqttjs:client streamErrorHandler :: error Username is required to use password
mqttjs:client noop :: Error: Username is required to use password
I should not have to enable DEBUG to see this, the error event should have been emitted to inform the rest of my application.
I checked the source and for some reason this.stream.on('error') seems to noop anything without an err.code which seems very wrong to me.
Minimal Reproduction
One simple way to reproduce is to try connecting with a password but no username, but it seems to suppress almost everything.
Debug logs
mqttjs:client _writePacket :: emitting `packetsend`
mqttjs:client _writePacket :: writing to stream
mqttjs:client _writePacket :: writeToStream result false
mqttjs:client streamErrorHandler :: error Username is required to use password
mqttjs:client noop :: Error: Username is required to use password
The text was updated successfully, but these errors were encountered:
MQTTjs Version
5.8.0
Broker
other
Environment
NodeJS
Description
For many kinds of error all you get is a
close
event - theerror
event is not emitted so you have no idea what the problem is.Adding
DEBUG=mqttjs:*
shows the following:I should not have to enable
DEBUG
to see this, theerror
event should have been emitted to inform the rest of my application.I checked the source and for some reason
this.stream.on('error')
seems tonoop
anything without anerr.code
which seems very wrong to me.Minimal Reproduction
One simple way to reproduce is to try connecting with a password but no username, but it seems to suppress almost everything.
Debug logs
The text was updated successfully, but these errors were encountered: