+
+ CORBA::SystemException* sysexc;
+ sysexc=CORBA::SystemException::_downcast(exc);
+ if(sysexc != NULL)
+ {
+ // It's a SystemException
+ DEBTRACE( "minor code: " << sysexc->minor() );
+ DEBTRACE( "completion code: " << sysexc->completed() );
+ std::string text="Execution problem: ";
+ std::string excname=sysexc->_name();
+ if(excname == "BAD_OPERATION")
+ {
+ text=text+"component '" +_ref+ "' has no service '" + _method+ "'";
+ }
+ else if(excname == "BAD_PARAM")
+ {
+ text=text+"A parameter (input or output) passed to the call is out of range or otherwise considered illegal.\n";
+ text=text+"Minor code: "+sysexc->NP_minorString();
+ }
+ else if(excname == "MARSHAL" && sysexc->minor() == omni::MARSHAL_PassEndOfMessage)
+ {
+ text=text+"probably an error in arguments of service '" + _method + "' from component '" +_ref+ "'";
+ }
+ else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_UnMarshalResults)
+ {
+ text=text+"probably an error in output arguments of service '" + _method + "' from component '" +_ref+ "'";
+ }
+ else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_UnMarshalArguments)
+ {
+ text=text+"probably an error in input arguments of service '" + _method + "' from component '" +_ref+ "'";
+ }
+ else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_WaitingForReply)
+ {
+ text=text+"probably an error in input arguments of service '" + _method + "' from component '" +_ref+ "'";
+ }
+ else
+ {
+ DEBTRACE(sysexc->NP_minorString() );
+ text=text+"System Exception "+ excname;
+ }
+ _errorDetails=text;
+ throw Exception(text);
+ }
+
+ // Not a System Exception
+ CORBA::UnknownUserException* userexc;
+ userexc=CORBA::UnknownUserException::_downcast(exc);
+ if(userexc != NULL)
+ {
+ CORBA::Any anyExcept = userexc->exception();
+
+ const SALOME::SALOME_Exception* salexc;
+ if(anyExcept >>= salexc)
+ {
+ DEBTRACE("SALOME_Exception: "<< salexc->details.sourceFile);
+ DEBTRACE("SALOME_Exception: "<<salexc->details.lineNumber);
+ _errorDetails=salexc->details.text;
+ throw Exception("Execution problem: Salome Exception occurred" + getErrorDetails() );
+ }
+ std::string msg="Execution problem: User Exception occurred";
+ _errorDetails=msg;
+ throw Exception(msg);
+ }
+ std::string msg="Execution problem";
+ _errorDetails=msg;
+ throw Exception(msg);