From 57cc4fd5a9c9485318af605d77bd4b8c7e4278f4 Mon Sep 17 00:00:00 2001 From: ApoorvaM Date: Thu, 8 Oct 2015 14:16:02 +0530 Subject: [PATCH] adding logs when plugin fails to start. #222 --- config/configuration.go | 3 ++- plugin/plugin.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index 0323f9650..3651d8ba6 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -109,7 +109,7 @@ func setCurrentProjectEnvVariable() error { func convertToTime(value string, defaultValue time.Duration, name string) time.Duration { intValue, err := strconv.Atoi(value) if err != nil { - apiLog.Warning("Incorrect value for %s in property file.Cannot convert %s to time", name, value) + apiLog.Warning("Incorrect value for %s in property file. Cannot convert %s to time", name, value) return defaultValue } return time.Millisecond * time.Duration(intValue) @@ -118,6 +118,7 @@ func convertToTime(value string, defaultValue time.Duration, name string) time.D var getFromConfig = func(propertyName string) string { config, err := common.GetGaugeConfiguration() if err != nil { + apiLog.Warning("Failed to get configuration from Gauge properties file. Error: %s", err.Error()) return "" } return config[propertyName] diff --git a/plugin/plugin.go b/plugin/plugin.go index 33c379388..16cab807f 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -245,7 +245,11 @@ func startPluginsForExecution(manifest *manifest.Manifest) (*PluginHandler, []st continue } envProperties[pluginConnectionPortEnv] = strconv.Itoa(gaugeConnectionHandler.ConnectionPortNumber()) - SetEnvForPlugin(executionScope, pd, manifest, envProperties) + err = SetEnvForPlugin(executionScope, pd, manifest, envProperties) + if err != nil { + warnings = append(warnings, fmt.Sprintf("Error setting environment for plugin %s %s. %s", pd.Name, pd.Version, err.Error())) + continue + } pluginCmd, err := StartPlugin(pd, executionScope, false) if err != nil {