Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
fix: catch socket errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Feb 5, 2019
1 parent 6b13c01 commit 8b299e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ module.exports = class DatadogTransport extends Transport {

socket.setKeepAlive(true);
socket.write(`${config.apiKey} ${JSON.stringify(logEntry)}\r\n`);
socket.on('error', error => {
// eslint-disable-next-line no-console
console.log('datadog socket error', error);
});
socket.end();

return callback();
Expand Down

0 comments on commit 8b299e9

Please sign in to comment.