diff --git a/src/domain/ErrorReportViewModel.ts b/src/domain/ErrorReportViewModel.ts index eb6ed0aa..68fe580c 100644 --- a/src/domain/ErrorReportViewModel.ts +++ b/src/domain/ErrorReportViewModel.ts @@ -49,9 +49,12 @@ export class ErrorReportViewModel extends ViewModel protected logAndCatch(labelOrValues: LabelOrValues, callback: LogCallback, errorValue: T = undefined as unknown as T): T { try { - const result = this.logger.run(labelOrValues, callback); + let result = this.logger.run(labelOrValues, callback); if (result instanceof Promise) { - result.catch(err => this.reportError(err)); + result = result.catch(err => { + this.reportError(err); + return errorValue; + }) as unknown as T; } return result; } catch (err) {