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

config: bubble up errors from configuration #618

Merged
merged 2 commits into from
Nov 17, 2022
Merged

Conversation

magiconair
Copy link
Member

The current config code has some options which can have errors. The current code calls log.Fatal which terminates the application instead of returning the error.

The correct solution would be to return the error in ApplyConfig and then return it in NewClient. However, this would break all existing clients.

We therefore postpone this breaking change to v0.5.0 when we update the API with breaking changes anyway and in the meantime bubble the error up in the Connect and Dial method.

Fixes #616

The current config code has some options which can have errors. The
current code calls `log.Fatal` which terminates the application instead
of returning the error.

The correct solution would be to return the error in ApplyConfig and
then return it in NewClient. However, this would break all existing
clients.

We therefore postpone this breaking change to v0.5.0 when we update the
API with breaking changes anyway and in the meantime bubble the error up
in the Connect and Dial method.

Fixes #616
@magiconair magiconair requested a review from kung-foo November 14, 2022 16:53
@magiconair magiconair merged commit f55ac12 into main Nov 17, 2022
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.

log.Fatal called when a certificate fails to load
1 participant