From e518541fd033b0645e65b2e94d74bed1f55b7a54 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 4 Apr 2022 09:38:17 +0000 Subject: [PATCH] gracefully handle setAccountData failure --- src/report/ReportPoll.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/report/ReportPoll.ts b/src/report/ReportPoll.ts index 7ae23cc..e1357ba 100644 --- a/src/report/ReportPoll.ts +++ b/src/report/ReportPoll.ts @@ -81,7 +81,11 @@ export class ReportPoll { if (response.next_token !== undefined) { this.from = response.next_token; - await this.mjolnir.client.setAccountData(REPORT_POLL_EVENT_TYPE, { from: response.next_token }); + try { + await this.mjolnir.client.setAccountData(REPORT_POLL_EVENT_TYPE, { from: response.next_token }); + } catch (ex) { + await this.mjolnir.logMessage(LogLevel.ERROR, "getAbuseReports", `failed to update progress: ${ex}`); + } } this.schedulePoll();