mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
catch telemtery error (#137986)
This commit is contained in:
parent
cd7578a26e
commit
db53455252
1 changed files with 8 additions and 5 deletions
|
@ -105,12 +105,15 @@ export class TelemetryEventsSender {
|
|||
this.isSending = false;
|
||||
}
|
||||
|
||||
private async fetchClusterInfo(): Promise<InfoResponse> {
|
||||
if (this.esClient === undefined || this.esClient === null) {
|
||||
throw Error('elasticsearch client is unavailable: cannot retrieve cluster infomation');
|
||||
private async fetchClusterInfo(): Promise<InfoResponse | undefined> {
|
||||
try {
|
||||
if (this.esClient === undefined || this.esClient === null) {
|
||||
throw Error('elasticsearch client is unavailable: cannot retrieve cluster infomation');
|
||||
}
|
||||
return await this.esClient.info();
|
||||
} catch (e) {
|
||||
this.logger.debug(`Error fetching cluster information: ${e}`);
|
||||
}
|
||||
|
||||
return await this.esClient.info();
|
||||
}
|
||||
|
||||
public async sendEvents(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue