mqtt 4.3.7 → 4.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mqtt.js +3 -9
- package/dist/mqtt.min.js +1 -1
- package/lib/client.js +3 -9
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -32,14 +32,6 @@ const defaultConnectOptions = {
|
|
|
32
32
|
resubscribe: true
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const socketErrors = [
|
|
36
|
-
'ECONNREFUSED',
|
|
37
|
-
'EADDRINUSE',
|
|
38
|
-
'ECONNRESET',
|
|
39
|
-
'ENOTFOUND'
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
// Other Socket Errors: EADDRINUSE, ECONNRESET, ENOTFOUND.
|
|
43
35
|
|
|
44
36
|
const errors = {
|
|
45
37
|
0: '',
|
|
@@ -454,7 +446,9 @@ MqttClient.prototype._setupStream = function () {
|
|
|
454
446
|
|
|
455
447
|
function streamErrorHandler (error) {
|
|
456
448
|
debug('streamErrorHandler :: error', error.message)
|
|
457
|
-
|
|
449
|
+
// error.code will only be set on NodeJS env, browse don't allow to detect erros on sockets
|
|
450
|
+
// also emitting errors on browser seems to create issues
|
|
451
|
+
if (error.code) {
|
|
458
452
|
// handle error
|
|
459
453
|
debug('streamErrorHandler :: emitting error')
|
|
460
454
|
that.emit('error', error)
|
package/package.json
CHANGED