-
Notifications
You must be signed in to change notification settings - Fork 271
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
refactor(connlib): remove Result
return values from callbacks
#4158
refactor(connlib): remove Result
return values from callbacks
#4158
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Terraform Cloud Plan Output
|
I think conceptually, we should adopt the following model:
(1) should only be considered a last-resort way of dealing with things, i.e. exceptions / panics shouldn't be the standard way of error handling. |
cacb188
to
1df9915
Compare
Performance Test ResultsTCP
UDP
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With both this and #4159, I'm more confused about how the callbacks are intended to work.
I'll add to my comment in the Slack thread about 4159
c065eaf
to
a98c40d
Compare
Mind re-reviewing this after the conversation we had on Slack? :) |
a98c40d
to
44200aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Hopefully the rest of the issues with callbacks get fixed some day
@conectado Do you have any opinions on this or can I merge? |
Currently, an error returned by
Tunnel::poll_next_event
is only logged. In other words, they are never fatal. This creates a tricky to understand relationship on what kind of errors should be returned from callbacks. Because connlib is used on multiple operating systems, it has no idea how fatal a particular error is.This PR removes all of these
Result
return values with the following consequences:on_disconnect
.Result
s for those callbacks. I don't know how exceptions from Swift are translated across the FFI layer but there is no change to what we had before.Resolves: #4064.