Skip to content

Connection failures cause crash #22

@normen

Description

@normen

I seem to have problems when the cube can't be found or theres other connection issues, the library causes a crash without any chance to catch the error:

at exports._errnoException (util.js:1018:11)
at TCP.onread (net.js:568:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
events.js:165
throw err;
^

Error: Uncaught, unspecified "error" event. (undefined)
at MaxCubeLowLevel.emit (events.js:163:17)
at Socket. (/usr/local/lib/node_modules/homebridge/node_modules/homebridge-platform-maxcube/node_modules/maxcube/maxcube-lowlevel.js:51:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

I use the 'connected' callback to start the connection and each time I send data to the cube I use the getConnection() promise so I don't understand why the library crashes without any chance to catch the error?

A possible workaround would maybe be accessing the maxCubeLowLevel field of my MaxCube instance and adding an error callback? But I think the MaxCube object should register for those and emit them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions