From 88a6c35392f6d175c3f8c8fed97167f184b4ef3e Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Mon, 12 Mar 2018 18:54:37 +0100
Subject: [PATCH] ENH: throw an exception when process is aborted

---
 Modules/IO/ImageIO/include/otbImageFileWriter.txx | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.txx b/Modules/IO/ImageIO/include/otbImageFileWriter.txx
index 454fdea478..2cfc72794d 100644
--- a/Modules/IO/ImageIO/include/otbImageFileWriter.txx
+++ b/Modules/IO/ImageIO/include/otbImageFileWriter.txx
@@ -649,6 +649,13 @@ ImageFileWriter<TInputImage>
     {
     this->UpdateProgress(1.0);
     }
+  else
+    {
+    itk::ProcessAborted e(__FILE__, __LINE__);
+    e.SetLocation(ITK_LOCATION);
+    e.SetDescription("Image writing has been aborted");
+    throw e;
+    }
 
   // Notify end event observers
   this->InvokeEvent(itk::EndEvent());
-- 
GitLab