Skip to content

Commit

Permalink
feat: improved error log
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGorilla committed Jul 17, 2024
1 parent 5cadb43 commit 6d5079e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/broadcastors/mempoolBroadcastor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export class MempoolBroadcastor {
await jobContract.callStatic[workMethod](...workArguments);
} catch (error: unknown) {
if (error instanceof Error) {
console.log(`Static call failed with ${error.message}`);
console.log(
`Static call failed. Job contract: ${jobContract.address}. Work method: ${workMethod}. Work arguments: ${[
...workArguments,
].join(', ')}. Error message: ${error.message}`
);
}
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/broadcastors/privateBroadcastor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export class PrivateBroadcastor {
await jobContract.callStatic[workMethod](...workArguments);
} catch (error: unknown) {
if (error instanceof Error) {
console.log(`Static call failed with ${error.message}`);
console.log(
`Static call failed. Job contract: ${jobContract.address}. Work method: ${workMethod}. Work arguments: ${[
...workArguments,
].join(', ')}. Error message: ${error.message}`
);
}
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/broadcastors/stealthBroadcastor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export class StealthBroadcastor {
await this.stealthRelayer.callStatic.execute(jobContract.address, workData, stealthHash, block.number);
} catch (error: unknown) {
if (error instanceof Error) {
console.log(`Static call failed with ${error.message}`);
console.log(
`Static call failed. Job contract: ${jobContract.address}. Work method: ${workMethod}. Work arguments: ${[
...workArguments,
].join(', ')}. Error message: ${error.message}`
);
}
return;
}
Expand Down

0 comments on commit 6d5079e

Please sign in to comment.