diff options
Diffstat (limited to 'packages/taler-wallet-core/src/shepherd.ts')
-rw-r--r-- | packages/taler-wallet-core/src/shepherd.ts | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts index d662bd7ae..050de479a 100644 --- a/packages/taler-wallet-core/src/shepherd.ts +++ b/packages/taler-wallet-core/src/shepherd.ts @@ -306,6 +306,7 @@ export class TaskSchedulerImpl implements TaskScheduler { const maybeNotification = await this.ws.db.runAllStoresReadWriteTx( {}, async (tx) => { + logger.trace(`storing task [reset] for ${taskId}`); await tx.operationRetries.delete(taskId); return taskToRetryNotification(this.ws, tx, taskId, undefined); }, @@ -325,7 +326,13 @@ export class TaskSchedulerImpl implements TaskScheduler { try { await info.cts.token.racePromise(this.ws.timerGroup.resolveAfter(delay)); } catch (e) { - logger.info(`waiting for ${taskId} interrupted`); + if (e instanceof CancellationToken.CancellationError) { + logger.info( + `waiting for ${taskId} interrupted: ${e.message} ${j2s(e.reason)}`, + ); + } else { + logger.info(`waiting for ${taskId} interrupted: ${e}`); + } } } @@ -363,6 +370,7 @@ export class TaskSchedulerImpl implements TaskScheduler { try { res = await callOperationHandlerForTaskId(wex, taskId); } catch (e) { + logger.trace(`Shepherd error ${taskId} saving response ${e}`); res = { type: TaskRunResultType.Error, errorDetail: getErrorDetailFromException(e), @@ -382,13 +390,11 @@ export class TaskSchedulerImpl implements TaskScheduler { }); switch (res.type) { case TaskRunResultType.Error: { - if (logger.shouldLogTrace()) { - logger.trace( - `Shepherd for ${taskId} got error result: ${j2s( - res.errorDetail, - )}`, - ); - } + // if (logger.shouldLogTrace()) { + logger.trace( + `Shepherd for ${taskId} got error result: ${j2s(res.errorDetail)}`, + ); + // } const retryRecord = await storePendingTaskError( this.ws, taskId, @@ -457,7 +463,7 @@ async function storePendingTaskError( pendingTaskId: string, e: TalerErrorDetail, ): Promise<OperationRetryRecord> { - logger.info(`storing pending task error for ${pendingTaskId}`); + logger.trace(`storing task [pending] with ERROR for ${pendingTaskId}`); const res = await ws.db.runAllStoresReadWriteTx({}, async (tx) => { let retryRecord = await tx.operationRetries.get(pendingTaskId); if (!retryRecord) { @@ -489,6 +495,7 @@ async function storeTaskProgress( ws: InternalWalletState, pendingTaskId: string, ): Promise<void> { + logger.trace(`storing task [progress] for ${pendingTaskId}`); await ws.db.runReadWriteTx( { storeNames: ["operationRetries"] }, async (tx) => { @@ -501,6 +508,7 @@ async function storePendingTaskPending( ws: InternalWalletState, pendingTaskId: string, ): Promise<OperationRetryRecord> { + logger.trace(`storing task [pending] for ${pendingTaskId}`); const res = await ws.db.runAllStoresReadWriteTx({}, async (tx) => { let retryRecord = await tx.operationRetries.get(pendingTaskId); let hadError = false; @@ -541,6 +549,7 @@ async function storePendingTaskFinished( ws: InternalWalletState, pendingTaskId: string, ): Promise<void> { + logger.trace(`storing task [finished] for ${pendingTaskId}`); await ws.db.runReadWriteTx( { storeNames: ["operationRetries"] }, async (tx) => { |