Skip to content

Commit

Permalink
[Telemetry] Handle Promise Rejection (#88815)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Jan 20, 2021
1 parent 69182a8 commit ad8589e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/telemetry/server/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,19 @@ export class FetcherTask {
updateTelemetrySavedObject(this.internalRepository!, {
reportFailureCount: 0,
lastReported: this.lastReported,
}).catch((err) => {
err.message = `Failed to update the telemetry saved object: ${err.message}`;
this.logger.debug(err);
});
}

private async updateReportFailure({ failureCount }: { failureCount: number }) {
updateTelemetrySavedObject(this.internalRepository!, {
reportFailureCount: failureCount + 1,
reportFailureVersion: this.currentKibanaVersion,
}).catch((err) => {
err.message = `Failed to update the telemetry saved object: ${err.message}`;
this.logger.debug(err);
});
}

Expand Down

0 comments on commit ad8589e

Please sign in to comment.