pinojs / pino-socket

🌲 A transport for sending pino logs to network sockets
43 stars 14 forks source link

Emit a reconnectFailure event #81

Closed ggrossetie closed 2 years ago

ggrossetie commented 2 years ago

err can be undefined on fail event when retryBackoff.backoff is called without an error object:

TypeError: Cannot read properties of undefined (reading 'message')
    at Backoff.<anonymous> (/path/to/project/node_modules/pino-socket/lib/TcpConnection.js:221:100)
    at Backoff.emit (node:events:520:28)
    at Backoff.backoff (/path/to/project/node_modules/backoff/lib/backoff.js:42:14)
    at reconnect (/path/to/project/node_modules/pino-socket/lib/TcpConnection.js:134:18)
    at Socket.closeListener (/path/to/project/node_modules/pino-socket/lib/TcpConnection.js:147:7)
    at Socket.emit (node:events:520:28)
    at TCP.<anonymous> (node:net:687:12)