From ded8bc26c1c356a5b76dedd6efae986700d878f7 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@cnes.fr>
Date: Wed, 20 Jun 2018 15:26:43 +0200
Subject: [PATCH] ENH: Do not catch exception when testenv option is used

---
 .../CommandLine/src/otbWrapperCommandLineLauncher.cxx         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
index 3fb816d134..e408cdca80 100644
--- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
+++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
@@ -159,13 +159,13 @@ bool CommandLineLauncher::ExecuteAndWriteOutput()
   // If testenv is used, do not catch exceptions
   if (m_Parser->IsAttributExists("-testenv", m_VExpression) == true)
     {
-    ExecuteAndWriteOutputNoCatch();
+    return ExecuteAndWriteOutputNoCatch();
     }
   else
     {
     try
       {
-      ExecuteAndWriteOutputNoCatch();
+      return ExecuteAndWriteOutputNoCatch();
       }
     catch(otb::ApplicationException& err)
       {
-- 
GitLab