over time, the socket is closed.
then the following error occurs:
Error: Error: read ETIMEDOUT
at TLSSocket.socket.on.error (/Users/Naver/entry-hw/node_modules/push-receiver/src/client/socket/index.js:56:11)
at emitOne (events.js:101:20)
at TLSSocket.emit (events.js:191:7)
at emitErrorNT (net.js:1283:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Socket closed
the problem is that this is not caught in try ~ catch.
electron-push-receiver/src/index.js
try {
// ...
} catch (e) {
console.error('PUSH_RECEIVER:::Error while starting the service', e);
// Forward error to the renderer process
webContents.send(NOTIFICATION_SERVICE_ERROR, e.message); // <-- not working
}
for this, i wrote the following code in the main process:
process.on('uncaughtException', function (error) {
// Handle the error
console.log(error);
});
over time, the socket is closed. then the following error occurs:
the problem is that this is not caught in
try ~ catch
.electron-push-receiver/src/index.js
for this, i wrote the following code in the main process:
i don't know why
try ~ catch
doesn't work.and how do i reconnect after i close the socket?
electron version: 1.7.8 os: osx el capitan