# HG changeset patch # User Sebastien Jodogne # Date 1572019590 -7200 # Node ID 08cc0d47aa948b1823a5b8658e88081e94d16a5d # Parent 66e21ef2d6578fb08eb828ea9ee0c7f65805a50c exception handling in IObservable::EmitMessage() diff -r 66e21ef2d657 -r 08cc0d47aa94 Framework/Messages/IObservable.cpp --- a/Framework/Messages/IObservable.cpp Fri Oct 25 14:58:06 2019 +0200 +++ b/Framework/Messages/IObservable.cpp Fri Oct 25 18:06:30 2019 +0200 @@ -21,8 +21,9 @@ #include "IObservable.h" +#include "../StoneException.h" + #include -#include #include @@ -75,7 +76,22 @@ if (receiver == NULL || // Are we broadcasting? observer.get() == receiver) // Not broadcasting, but this is the receiver { - (*it)->Apply(message); + try + { + (*it)->Apply(message); + } + catch (Orthanc::OrthancException& e) + { + LOG(ERROR) << "Exception on callable: " << e.What(); + } + catch (StoneException& e) + { + LOG(ERROR) << "Exception on callable: " << e.What(); + } + catch (...) + { + LOG(ERROR) << "Native exception on callable"; + } } } else