Skip to content

Commit

Permalink
resolve promise if status is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Oct 26, 2024
1 parent 9d26933 commit 578726b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/worker-api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ export class Worker implements IWorkerBase {
console.log(`TrustedOperationStatus: ${directRequestStatus}`);
const status = directRequestStatus.asTrustedOperationStatus;

if (status.isInvalid || status.isUsurped || status.isDropped) {
console.debug(`Trusted operation failed to execute: ${status.toHuman()}`);
resolve({topHash, status});
}

if (connection_can_be_closed(status)) {
resolve({topHash, status});
}
Expand Down

0 comments on commit 578726b

Please sign in to comment.