Skip to content

Commit

Permalink
Adding more detailed error message when backend is unable to contact …
Browse files Browse the repository at this point in the history
…logstash
  • Loading branch information
epacke committed Nov 18, 2024
1 parent f6987a6 commit 82e602f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pipeline-ui/backend/src/api/v1/sendLogLines/sendTCPString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import {LOGSTASH} from '../../../constants/LogstashAddress';
import logger from '../../../util/Logger';

function sendTCP(payload: string, port: number) {
const conn = net.createConnection({host: LOGSTASH, port: port}, function() {
const conn = net.createConnection({host: LOGSTASH, port: port}, function () {
conn.write(payload);
}).on('error', function(err) {
logger.error(`Failed to send payload to ${port}.
Has all logstash pipelines started successfully?`);
}).on('error', function (err) {
logger.error({
message: `Failed to send payload to ${port}.` +
`Has all logstash pipelines started successfully?`,
payload,
details: err.message,
});
});
}

Expand Down

0 comments on commit 82e602f

Please sign in to comment.