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

Propagate errors in tls_config instead of unwrap/panic #385

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

repi
Copy link
Contributor

@repi repi commented Jul 2, 2020

Motivation

We ran into tls_connector failing and causing our app to panic and shutdown as it seems there wasn't any way to avoid panicking in tls_config.

Solution

So after talking to @LucioFranco briefly tls_config now returns a Result instead and propagates errors to the caller, where they have to be handled.

This is a bit of an intrusive change to the API here. could alternatively introduce an additional tls_config function that does the error handling and keep the existing unwrapping one, to allow it to become an additive opt-in minor semver change instead?

Ran into `tls_connector` failing and causing our app to panic and shutdown as it seems there wasn't any way to avoid panicking in `tls_config`.

So after talking to @LucioFranco briefly `tls_config` now returns a `Result` instead and propagates errors to the caller, where they can be handled.
@LucioFranco
Copy link
Member

This seems 👍 to me @jen20 thoughts?

@LucioFranco
Copy link
Member

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Thanks!

@LucioFranco LucioFranco merged commit 3b9d6a6 into hyperium:master Jul 6, 2020
@jen20
Copy link
Contributor

jen20 commented Jul 7, 2020

Sorry, I didn't see this until now - this looks great to me.

@fujiapple852
Copy link

Note that Cargo's modified SemVer logic treats 0.2.2 as a compatible update from 0.2.1 and thus this release of tonic causes a break. Trivial to fix but perhaps yanking and releasing as 0.3.0 would be better?

@LucioFranco
Copy link
Member

@fujiapple852 you're right.....sigh will do that today.

@LucioFranco
Copy link
Member

Getting a 0.3.0 release out right now. @fujiapple852 thanks for pointing this out!

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.

4 participants