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

Discuss: return error for Provider(cfg Config) #233

Closed
missedone opened this issue Sep 13, 2023 · 1 comment · Fixed by #234
Closed

Discuss: return error for Provider(cfg Config) #233

missedone opened this issue Sep 13, 2023 · 1 comment · Fixed by #234
Labels
bug Something isn't working

Comments

@missedone
Copy link
Contributor

@knadh i'd like to discuss the API change

almost all the provider func returns the object without error

example:

func Provider(cfg Config) *Vault {
...
}

I'm thinking of returning an error along with provider object:

func Provider(cfg Config) (*Vault, error) {
...
}

i think the original func signature support the inline the Provider instantiation within k.Load(...), but for Vault, S3 and other providers relies on the external system, it pretty much return nil if something wrong in the config or network, etc.
hence a panic threw out and the app process gets exit.

it's not very friendly to diagnose the issue.

@missedone missedone added the bug Something isn't working label Sep 13, 2023
@knadh
Copy link
Owner

knadh commented Sep 13, 2023

Yes, indeed. We can do a v2 release for the provider to accommodate the breaking change.

knadh pushed a commit that referenced this issue Sep 23, 2023
…king change. (#234, #233)

The breaking change in the external provider init will require the providers in the PR to get a `v2` tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants