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

Improve error handling #7

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Conversation

lukipuki
Copy link
Collaborator

@lukipuki lukipuki commented Jan 21, 2024

Improve error handling

Propagate errors in the handlers. The errors are now caught in the disconnect function but we should work towards notifying the user even sooner.

This is an improvement though, as previously the user hasn't been notified at all.

@lukipuki lukipuki force-pushed the error-handling branch 2 times, most recently from 1d53d77 to 8d68e52 Compare January 23, 2024 07:41
@lukipuki lukipuki marked this pull request as ready for review January 23, 2024 09:07
Propagate errors in the handlers. The errors are now caught in the
`disconnect` function but we should work towards notifying the user
even sooner.

This is an improvement though, as previously the user hasn't been
notified at all.
// Note: we only return the first error.
read_result??;
write_result??;
processing_result??;
Copy link
Member

Choose a reason for hiding this comment

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

Is the ?? something the user will need to do regularly? This feels like an annoying pattern

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is an internal function and we can certainly make it nicer in a public interface, but I haven't finalized my thoughts on it.

@ajmcquilkin ajmcquilkin merged commit 3a61a21 into meshtastic:main Jan 23, 2024
3 checks passed
@lukipuki lukipuki deleted the error-handling branch January 24, 2024 13:07
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