logging / do not crash on error

This commit is contained in:
Florian Dold 2020-08-28 22:05:35 +05:30
parent c35b83cae1
commit 5c0ee81e26
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -349,16 +349,16 @@ async function processPlanchetExchangeRequest(
resp, resp,
codecForWithdrawResponse(), codecForWithdrawResponse(),
); );
logger.trace(`got response for /withdraw`);
return r; return r;
} catch (e) { } catch (e) {
logger.trace("withdrawal request failed", e);
logger.trace(e);
if (!(e instanceof OperationFailedError)) { if (!(e instanceof OperationFailedError)) {
throw e; throw e;
} }
const errDetails = e.operationError; const errDetails = e.operationError;
await ws.db.runWithWriteTransaction([Stores.planchets], async (tx) => { await ws.db.runWithWriteTransaction([Stores.planchets], async (tx) => {
let planchet = await ws.db.getIndexed(Stores.planchets.byGroupAndIndex, [ let planchet = await tx.getIndexed(Stores.planchets.byGroupAndIndex, [
withdrawalGroupId, withdrawalGroupId,
coinIdx, coinIdx,
]); ]);