From b5b8f96cc94e3a3c0ee7d989819197ab5df393cd Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 12 Mar 2020 19:25:38 +0530 Subject: improved error reporting / towards a working recoup --- src/wallet.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/wallet.ts') diff --git a/src/wallet.ts b/src/wallet.ts index 3b619f874..9cba1360e 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -113,6 +113,7 @@ import { } from "./operations/refund"; import { durationMin, Duration } from "./util/time"; import { processRecoupGroup } from "./operations/recoup"; +import { OperationFailedAndReportedError } from "./operations/errors"; const builtinCurrencies: CurrencyRecord[] = [ { @@ -235,7 +236,11 @@ export class Wallet { try { await this.processOnePendingOperation(p, forceNow); } catch (e) { - console.error(e); + if (e instanceof OperationFailedAndReportedError) { + console.error("Operation failed:", JSON.stringify(e.operationError, undefined, 2)); + } else { + console.error(e); + } } } } -- cgit v1.2.3