%{
#include "KernelServices.hxx"
+#include "Utils_SALOME_Exception.hxx"
%}
+%exceptionclass SALOME_Exception;
+
+class SALOME_Exception
+{
+public:
+ SALOME_Exception(const std::string& text);
+ ~SALOME_Exception() noexcept;
+ const char *what() const noexcept;
+ %extend
+ {
+ std::string __str__() const
+ {
+ return std::string(self->what());
+ }
+ }
+};
+
+%exception {
+ try {
+ $action
+ }
+ catch (SALOME_Exception& _e) {
+ // Reraise with SWIG_Python_Raise
+ SWIG_Python_Raise(SWIG_NewPointerObj((new SALOME_Exception(static_cast< const SALOME_Exception& >(_e))),SWIGTYPE_p_SALOME_Exception,SWIG_POINTER_OWN), "SALOME_Exception", SWIGTYPE_p_SALOME_Exception);
+ SWIG_fail;
+ }
+}
+
%inline
{
void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR);
#include "SALOME_KernelServices.hxx"
#include "SALOME_Fake_NamingService.hxx"
+#include "Utils_SALOME_Exception.hxx"
#include <map>
#include <memory>
CORBA::Object_var RetrieveCompo(const std::string& compoName)
{
+ CORBA::Object_var ret;
auto it = _compo_map.find(compoName);
if( it != _compo_map.end() )
{
- return (*it).second;
+ ret = (*it).second;
}
else
{
- SALOME::SALOME_Exception ex(createSalomeException("RetrieveCompo : not implemented yet !"));
- throw ex;
- //GetLCC()->FindOrLoad_Component( "FactoryServer", compoName );
+ //SALOME::SALOME_Exception ex(createSalomeException("RetrieveCompo : not implemented yet !"));
+ //throw ex;
+ throw SALOME_Exception("RetrieveCompo : not implemented yet !");
+ //GetLCC()->FindOrLoad_Component( "FactoryServer", compoName );
}
+ return ret._retn();
}
}