Skip to content

Improve decodeMessage: safer error handling and modern ethers imports #1017

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeevick10
Copy link

Description

  • Refactored decodeMessage to handle invalid input gracefully (returns null instead of throwing).
  • Updated imports to use the recommended ethers v6+ style.

Copy link
Contributor

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

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

Thanks for raising this @zeevick10!

One issue with this change is that returning null in all cases swallows the actual errors which is useful information to the developer

Another pattern is to have tryDothing and doThing where one function fails gracefully and the other throws all errors. But not sure we want to do that here.

@vplasencia what are your thoughts on this?

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