Пример #1
0
//-----------------------------------------------------------------------------//
std::string CCorbaErrorHelper::ToString(const CORBA::SystemException& err)
{
	std::string errDescription;
	TCHAR buf[50];
	memset(buf, 0, sizeof(TCHAR) * 50);
	
	CORBA::Any tmp;
	tmp <<= err;
	CORBA::TypeCode_var tc = tmp.type();

	errDescription = std::string(tc->name()) + _T(" Description: ") + err.NP_minorString();
	errDescription += _T(" Minor code: ");
	errDescription += _ltoa_s(err.minor(), buf, 50, 10);

	return errDescription;
}
Пример #2
0
inline void et_CORBA_SystemException( const CORBA::SystemException & e ) {
	std::ostringstream os;
	os<<"CORBA system exception: ";
#if defined(MICO_VERSION)
	e._print(os);
#elif defined(OMNIORB_DIST_DATE)
	os<<"minor: "<<e.NP_minorString()<<"; completed: ";
	switch(e.completed()) {
	case CORBA::COMPLETED_YES: os<<"YES"; break;
	case CORBA::COMPLETED_NO: os<<"NO"; break;
	default: os<<"MAYBE";
	}
#else
	os<<"minor: "<<e.minor()<<"; completed: ";
	switch(e.completed()) {
	case CORBA::COMPLETED_YES: os<<"YES"; break;
	case CORBA::COMPLETED_NO: os<<"NO"; break;
	default: os<<"MAYBE";
	}
#endif
	BOOST_ERROR(os.str());
}