added error for remote configuration not found

This commit is contained in:
Brian Ketelsen 2014-10-27 11:03:11 -04:00
parent c33e690687
commit d2d8f6caa1
1 changed files with 7 additions and 2 deletions

View File

@ -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) {