mirror of https://github.com/spf13/viper.git
added error for remote configuration not found
This commit is contained in:
parent
c33e690687
commit
d2d8f6caa1
9
viper.go
9
viper.go
|
@ -508,7 +508,6 @@ func insensativiseMaps() {
|
||||||
|
|
||||||
// retrieve the first found remote configuration
|
// retrieve the first found remote configuration
|
||||||
func getKeyValueConfig() error {
|
func getKeyValueConfig() error {
|
||||||
var err error
|
|
||||||
for _, rp := range remoteProviders {
|
for _, rp := range remoteProviders {
|
||||||
val, err := getRemoteConfig(rp)
|
val, err := getRemoteConfig(rp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -517,7 +516,13 @@ func getKeyValueConfig() error {
|
||||||
kvstore = val
|
kvstore = val
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
return RemoteConfigError("No Files Found")
|
||||||
|
}
|
||||||
|
|
||||||
|
type RemoteConfigError string
|
||||||
|
|
||||||
|
func (rce RemoteConfigError) Error() string {
|
||||||
|
return fmt.Sprintf("Remote Configurations Error: %s", string(rce))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRemoteConfig(provider *remoteProvider) (map[string]interface{}, error) {
|
func getRemoteConfig(provider *remoteProvider) (map[string]interface{}, error) {
|
||||||
|
|
Loading…
Reference in New Issue