diff --git a/Framework/KubernetesWorkflow/StartupWorkflow.cs b/Framework/KubernetesWorkflow/StartupWorkflow.cs index 3cf59a1..c8635d4 100644 --- a/Framework/KubernetesWorkflow/StartupWorkflow.cs +++ b/Framework/KubernetesWorkflow/StartupWorkflow.cs @@ -1,4 +1,5 @@ using Logging; +using Newtonsoft.Json; using Utils; namespace KubernetesWorkflow @@ -195,17 +196,33 @@ namespace KubernetesWorkflow private void K8s(Action action) { - var controller = new K8sController(log, cluster, knownK8SPods, numberSource, k8sNamespace); - action(controller); - controller.Dispose(); + try + { + var controller = new K8sController(log, cluster, knownK8SPods, numberSource, k8sNamespace); + action(controller); + controller.Dispose(); + } + catch (k8s.Autorest.HttpOperationException ex) + { + log.Error(JsonConvert.SerializeObject(ex)); + throw; + } } private T K8s(Func action) { - var controller = new K8sController(log, cluster, knownK8SPods, numberSource, k8sNamespace); - var result = action(controller); - controller.Dispose(); - return result; + try + { + var controller = new K8sController(log, cluster, knownK8SPods, numberSource, k8sNamespace); + var result = action(controller); + controller.Dispose(); + return result; + } + catch (k8s.Autorest.HttpOperationException ex) + { + log.Error(JsonConvert.SerializeObject(ex)); + throw; + } } } diff --git a/ProjectPlugins/CodexContractsPlugin/CodexContractsStarter.cs b/ProjectPlugins/CodexContractsPlugin/CodexContractsStarter.cs index ea8fe4b..60a7104 100644 --- a/ProjectPlugins/CodexContractsPlugin/CodexContractsStarter.cs +++ b/ProjectPlugins/CodexContractsPlugin/CodexContractsStarter.cs @@ -33,9 +33,9 @@ namespace CodexContractsPlugin { return DeployContract(container, workflow, gethNode); } - catch + catch (Exception ex) { - Log("Failed to deploy contract."); + Log("Failed to deploy contract: " + ex); Log("Downloading Codex SmartContracts container log..."); ci.DownloadLog(container); throw;