diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-06 23:32:01 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-06 23:32:01 +0530 |
commit | 47787c0b0b846d5f4a057661efdd05d8786032f1 (patch) | |
tree | 3a3d58a5ebad8af584de6a6cd882c2019f71dffa /src/operations/refund.ts | |
parent | f36bb7a04eabe0330cb166bf9ce5021c92f38dc8 (diff) | |
download | wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.gz wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.bz2 wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.zip |
make linter less grumpy
Diffstat (limited to 'src/operations/refund.ts')
-rw-r--r-- | src/operations/refund.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/operations/refund.ts b/src/operations/refund.ts index 74d4b848e..af9a48895 100644 --- a/src/operations/refund.ts +++ b/src/operations/refund.ts @@ -302,7 +302,7 @@ export async function processPurchaseQueryRefund( proposalId: string, forceNow = false, ): Promise<void> { - const onOpErr = (e: OperationError) => + const onOpErr = (e: OperationError): Promise<void> => incrementPurchaseQueryRefundRetry(ws, proposalId, e); await guardOperationException( () => processPurchaseQueryRefundImpl(ws, proposalId, forceNow), @@ -313,7 +313,7 @@ export async function processPurchaseQueryRefund( async function resetPurchaseQueryRefundRetry( ws: InternalWalletState, proposalId: string, -) { +): Promise<void> { await ws.db.mutate(Stores.purchases, proposalId, (x) => { if (x.refundStatusRetryInfo.active) { x.refundStatusRetryInfo = initRetryInfo(); @@ -368,7 +368,7 @@ export async function processPurchaseApplyRefund( proposalId: string, forceNow = false, ): Promise<void> { - const onOpErr = (e: OperationError) => + const onOpErr = (e: OperationError): Promise<void> => incrementPurchaseApplyRefundRetry(ws, proposalId, e); await guardOperationException( () => processPurchaseApplyRefundImpl(ws, proposalId, forceNow), @@ -379,7 +379,7 @@ export async function processPurchaseApplyRefund( async function resetPurchaseApplyRefundRetry( ws: InternalWalletState, proposalId: string, -) { +): Promise<void> { await ws.db.mutate(Stores.purchases, proposalId, (x) => { if (x.refundApplyRetryInfo.active) { x.refundApplyRetryInfo = initRetryInfo(); @@ -435,11 +435,10 @@ async function processPurchaseApplyRefundImpl( // We're too late, refund is expired. newRefundsFailed[pk] = info; break; - default: + default: { let body: string | null = null; - try { - body = await resp.json(); - } catch {} + // FIXME: error handling! + body = await resp.json(); const m = "refund request (at exchange) failed"; throw new OperationFailedError({ message: m, @@ -448,6 +447,7 @@ async function processPurchaseApplyRefundImpl( body, }, }); + } } } let allRefundsProcessed = false; |