]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Events/Events_Error.cpp
Salome HOME
Empty AIS in the viewer: throw c++ exception (to be finalized, currently do nothing)
[modules/shaper.git] / src / Events / Events_Error.cpp
index 4b7670e8ef55e1c54794c6880b01b4191151c7ed..c646cbf0cae5cf598a79c395c629bbc404d22d9d 100644 (file)
@@ -10,6 +10,8 @@
 #include <Events_Error.h>
 #include <Events_Loop.h>
 
+//#define TROW_EMPTY_AIS_EXCEPTION
+
 Events_Error::Events_Error(const std::string& theDescription, const void* theSender)
     : Events_Message(Events_Error::errorID(), theSender)
 {
@@ -37,3 +39,16 @@ void Events_Error::send(const std::string& theDescription, const void* theSender
     std::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
   Events_Loop::loop()->send(aNewOne);
 }
+
+void Events_Error::throwException(const std::string& theDescription)
+{
+#ifdef TROW_EMPTY_AIS_EXCEPTION
+  try {
+    throw std::invalid_argument(theDescription);
+  }
+  catch (...) {
+    Events_Error::send(
+        std::string("An exception: ") + theDescription);
+  }
+#endif
+}
\ No newline at end of file