From 44e6e3216563cf56e5537b706f43b75cc8e8f05a Mon Sep 17 00:00:00 2001 From: Rob Zienert Date: Tue, 10 Oct 2017 11:02:39 -0700 Subject: [PATCH] fix(pipeline_template): Propagate nested render errors --- .../handler/PipelineTemplateErrorHandler.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/handler/PipelineTemplateErrorHandler.kt b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/handler/PipelineTemplateErrorHandler.kt index 5af4b327a9..f400e44a44 100644 --- a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/handler/PipelineTemplateErrorHandler.kt +++ b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/handler/PipelineTemplateErrorHandler.kt @@ -36,10 +36,16 @@ class PipelineTemplateErrorHandler : Handler { private fun generateErrors(t: Throwable): Errors { val e = Errors() if (t is TemplateLoaderException) { - e.add(Errors.Error().withMessage("failed loading template").withCause(t.message)) + if (t.errors.hasErrors(true)) { + e.addAll(t.errors) + } else { + e.add(Errors.Error().withMessage("failed loading template").withCause(t.message)) + } } else if (t is TemplateRenderException) { - if (!e.hasErrors(true)) { + if (!t.errors.hasErrors(true)) { e.add(Errors.Error().withMessage("failed rendering template expression").withCause(t.message)) + } else { + e.addAll(t.errors) } } else if (t is IllegalTemplateConfigurationException) { e.add(