From dfb5dfc15788279f7d4618958e5d5405f39d1a00 Mon Sep 17 00:00:00 2001 From: ArthurHlt Date: Fri, 1 Mar 2019 17:14:20 +0100 Subject: [PATCH] show decoder error in loader --- loader/loader.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loader/loader.go b/loader/loader.go index 6c9d283..9c05a14 100644 --- a/loader/loader.go +++ b/loader/loader.go @@ -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)