Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve error handling #284

Merged
merged 6 commits into from
Jan 24, 2024
Merged

fix: improve error handling #284

merged 6 commits into from
Jan 24, 2024

Conversation

wemeetagain
Copy link
Member

Motivation

Notes

  • refactor callback handling
    • move from callback style (err, resp) => void to deferred promise style {resolve: (err) => void, reject: (err) => void}
    • ensure callbacks are called in each rpc handler and in each error case
  • remove hanging promises
    • add linter rule to ensure nothing remaining
  • move error handling of node contacts into getNodeContact rather than the getNodeAddress "getter"
    • this makes error handling much more predictable, throwing upfront, rather than waiting for a later event to trigger an error
  • wrap rpc handlers in try/catch statements
    • ensure that logic handed in rpc request and response handlers are unable to trigger unhandled exceptions

@wemeetagain wemeetagain requested a review from a team as a code owner January 19, 2024 23:05
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants