Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
dtl: error logging with message, stack and code (ethereum-optimism#758)
Browse files Browse the repository at this point in the history
* dtl: error logging with message, stack and code

* chore: add changeset
  • Loading branch information
tynes authored May 5, 2021
1 parent 3ea9ec8 commit cf2bfbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-days-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/data-transport-layer': patch
---

Better error logging in the DTL
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,13 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
}
} catch (err) {
if (!this.running || this.options.dangerouslyCatchAllErrors) {
this.logger.error('Caught an unhandled error', { err })
this.logger.error('Caught an unhandled error', {
message: err.toString(),
stack: err.stack,
code: err.code,
})
await sleep(this.options.pollingInterval)
} else {
// TODO: Is this the best thing to do here?
throw err
}
}
Expand Down

0 comments on commit cf2bfbc

Please sign in to comment.