Skip to content

Commit

Permalink
show decoder error in loader
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHlt committed Mar 1, 2019
1 parent 2e158b2 commit dfb5dfc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,13 @@ func (l *GautocloudLoader) load(connector connectors.Connector) []StoredService
for _, service := range services {
element := reflect.New(serviceType)
err := decoder.UnmarshalToValue(service.Credentials, element, false)
entry.Error("Error when loading service: %s", err.Error())
if err != nil {
entry.Errorf(logMessage("Error occurred during loading connector: %s\n"), err.Error())
}
eltInterface := element.Elem().Interface()
loadedService, err := connector.Load(eltInterface)
if err != nil {
entry.Errorf(logMessage("Error occured during loading connector: %s\n"), err.Error())
entry.Errorf(logMessage("Error occurred during loading connector: %s\n"), err.Error())
continue
}
reflectType := reflect.TypeOf(loadedService)
Expand Down

0 comments on commit dfb5dfc

Please sign in to comment.