The current build of Mqtt.JS is pretty sketchy with regard to error reporting for "expected" errors, things like: authorization failures or bad connection URLs. The is an onError hook, but for whatever reason it doesn't seem to fire for many of these situations, and for others it fires but returns nonsense error messages. (Tak a look at the Mqtt.JS repo issues for more details)
Anyway - I don't think it's worth holding up the rest of this project in order to try to find fixes/workarounds, but there at least should be an issue that tracks the status of these errors.
Connection errors:
The current build of Mqtt.JS is pretty sketchy with regard to error reporting for "expected" errors, things like: authorization failures or bad connection URLs. The is an
onErrorhook, but for whatever reason it doesn't seem to fire for many of these situations, and for others it fires but returns nonsense error messages. (Tak a look at the Mqtt.JS repo issues for more details)Anyway - I don't think it's worth holding up the rest of this project in order to try to find fixes/workarounds, but there at least should be an issue that tracks the status of these errors.
Connection errors:
exception fires inside
mqtt.connect()but error object is "{ }"mqtt.connect()succeeds and an exception fires afterward. Error object is {"isTrusted":true}