Skip to content

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

Closed
@missedone

Description

@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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions