X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Error.cpp;h=1dc1012f2d17144594fecd9723a2e6f32ffb5638;hb=6e39296196ae2208bec64c011e9429abca5ab037;hp=712478c894c2e049a16b264b14723304805a6652;hpb=9e869ede4d8c56262bb20534543c2bf56cd6a91b;p=modules%2Fshaper.git diff --git a/src/Events/Events_Error.cpp b/src/Events/Events_Error.cpp index 712478c89..1dc1012f2 100644 --- a/src/Events/Events_Error.cpp +++ b/src/Events/Events_Error.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Events_Error.cpp * @@ -8,7 +10,9 @@ #include #include -Events_Error::Events_Error(char* theDescription, const void* theSender) +#define THROW_EMPTY_AIS_EXCEPTION + +Events_Error::Events_Error(const std::string& theDescription, const void* theSender) : Events_Message(Events_Error::errorID(), theSender) { myDescription = theDescription; @@ -24,19 +28,22 @@ Events_ID Events_Error::errorID() return aLoop->eventByName("ApplicationError"); } -char* Events_Error::description() const +const char* Events_Error::description() const { - return myDescription; + return myDescription.c_str(); } -void Events_Error::send(char* theDescription, const void* theSender) +void Events_Error::send(const std::string& theDescription, const void* theSender) { std::shared_ptr aNewOne = std::shared_ptr(new Events_Error(theDescription, theSender)); Events_Loop::loop()->send(aNewOne); } -void Events_Error::send(std::string theDescription, const void* theSender) +void Events_Error::throwException(const std::string& theDescription) { - Events_Error::send((char*) theDescription.c_str(), theSender); +#ifdef THROW_EMPTY_AIS_EXCEPTION + Events_Error::send( + std::string("An exception: ") + theDescription); +#endif }