本文整理汇总了C++中ice::Exception类的典型用法代码示例。如果您正苦于以下问题:C++ Exception类的具体用法?C++ Exception怎么用?C++ Exception使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Exception类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exception_CasB
virtual void exception_CasB(const Ice::Exception& exc)
{
try
{
exc.ice_throw();
}
catch(const C& ex)
{
test(ex.aMem == 1);
test(ex.bMem == 2);
test(ex.cMem == 3);
}
catch(...)
{
test(false);
}
called();
}
示例2: catch
void
exception_unknownDerivedAsBase(const Ice::Exception& exc)
{
try
{
exc.ice_throw();
}
catch(const Base& b)
{
test(b.b == "UnknownDerived.b");
test(b.ice_id() == "::Test::Base");
}
catch(...)
{
test(false);
}
called();
}
示例3: catch
void
exception_knownDerivedAsKnownDerived(const Ice::Exception& exc)
{
try
{
exc.ice_throw();
}
catch(const KnownDerived& k)
{
test(k.b == "KnownDerived.b");
test(k.kd == "KnownDerived.kd");
test(k.ice_id() == "::Test::KnownDerived");
}
catch(...)
{
test(false);
}
called();
}
示例4: exceptAbortI
void exceptAbortI(const Ice::Exception& ex)
{
try
{
ex.ice_throw();
}
catch(const Ice::ConnectionLostException&)
{
}
catch(const Ice::ConnectFailedException&)
{
}
catch(const Ice::Exception& ex)
{
cout << ex << endl;
test(false);
}
called();
}
示例5: if
void
ProxyOutgoingAsyncBase::abort(const Ice::Exception& ex)
{
assert(!_childObserver);
if(finished(ex))
{
invokeCompletedAsync();
}
else if(dynamic_cast<const Ice::CommunicatorDestroyedException*>(&ex))
{
//
// If it's a communicator destroyed exception, don't swallow
// it but instead notify the user thread. Even if no callback
// was provided.
//
ex.ice_throw();
}
}
示例6: exception_AorDasAorD
virtual void exception_AorDasAorD(const Ice::Exception& exc)
{
try
{
exc.ice_throw();
}
catch(const A& ex)
{
test(ex.aMem == 1);
}
catch(const D& ex)
{
test(ex.dMem == -1);
}
catch(...)
{
test(false);
}
called();
}
示例7: ServerNotExistException
void
handleException(const Ice::Exception& ex) const
{
try
{
ex.ice_throw();
}
catch(const Ice::UserException&)
{
throw;
}
catch(const Ice::ObjectNotExistException&)
{
throw ServerNotExistException(_id);
}
catch(const Ice::LocalException& e)
{
ostringstream os;
os << e;
throw NodeUnreachableException(_node, os.str());
}
}
示例8: exception_ModA
virtual void exception_ModA(const Ice::Exception& exc)
{
try
{
exc.ice_throw();
}
catch(const Mod::A& ex)
{
test(ex.aMem == 1);
test(ex.a2Mem == 2);
}
catch(const Ice::OperationNotExistException&)
{
//
// This operation is not supported in Java.
//
}
catch(...)
{
test(false);
}
called();
}
示例9: out
void
IceInternal::LocatorInfo::getEndpointsException(const ReferencePtr& ref, const Ice::Exception& exc)
{
assert(ref->isIndirect());
try
{
exc.ice_throw();
}
catch(const AdapterNotFoundException&)
{
if(ref->getInstance()->traceLevels()->location >= 1)
{
Trace out(ref->getInstance()->initializationData().logger,
ref->getInstance()->traceLevels()->locationCat);
out << "adapter not found" << "\n";
out << "adapter = " << ref->getAdapterId();
}
NotRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "object adapter";
ex.id = ref->getAdapterId();
throw ex;
}
catch(const ObjectNotFoundException&)
{
if(ref->getInstance()->traceLevels()->location >= 1)
{
Trace out(ref->getInstance()->initializationData().logger,
ref->getInstance()->traceLevels()->locationCat);
out << "object not found" << "\n";
out << "object = " << ref->getInstance()->identityToString(ref->getIdentity());
}
NotRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "object";
ex.id = ref->getInstance()->identityToString(ref->getIdentity());
throw ex;
}
catch(const NotRegisteredException&)
{
throw;
}
catch(const LocalException& ex)
{
if(ref->getInstance()->traceLevels()->location >= 1)
{
Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat);
out << "couldn't contact the locator to retrieve adapter endpoints\n";
if(ref->getAdapterId().empty())
{
out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n";
}
else
{
out << "adapter = " << ref->getAdapterId() << "\n";
}
out << "reason = " << ex;
}
throw;
}
}
示例10: ice_exception
void AMI_PeraWsAstICE_CreateWSByXpdlStream_I::ice_exception( const Ice::Exception& ex )
{
SendIceMsg( ex.ice_name().c_str(), "createws" );
}
示例11: if
void
IceInternal::IncomingBase::__handleException(const Ice::Exception& ex)
{
try
{
ex.ice_throw();
}
catch(RequestFailedException& ex)
{
if(ex.id.name.empty())
{
ex.id = _current.id;
}
if(ex.facet.empty() && !_current.facet.empty())
{
ex.facet = _current.facet;
}
if(ex.operation.empty() && !_current.operation.empty())
{
ex.operation = _current.operation;
}
if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1)
{
__warning(ex);
}
if(_response)
{
_os.endWriteEncaps();
_os.b.resize(headerSize + 4); // Dispatch status position.
if(dynamic_cast<ObjectNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchObjectNotExist));
}
else if(dynamic_cast<FacetNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchFacetNotExist));
}
else if(dynamic_cast<OperationNotExistException*>(&ex))
{
_os.write(static_cast<Byte>(DispatchOperationNotExist));
}
else
{
assert(false);
}
ex.id.__write(&_os);
//
// For compatibility with the old FacetPath.
//
if(ex.facet.empty())
{
_os.write(static_cast<string*>(0), static_cast<string*>(0));
}
else
{
_os.write(&ex.facet, &ex.facet + 1);
}
_os.write(ex.operation, false);
_connection->sendResponse(&_os, _compress);
}
else
{
_connection->sendNoResponse();
}
}
catch(const UnknownLocalException& ex)
{
if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
{
__warning(ex);
}
if(_response)
{
_os.endWriteEncaps();
_os.b.resize(headerSize + 4); // Dispatch status position.
_os.write(static_cast<Byte>(DispatchUnknownLocalException));
_os.write(ex.unknown, false);
_connection->sendResponse(&_os, _compress);
}
else
{
_connection->sendNoResponse();
}
}
catch(const UnknownUserException& ex)
{
if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
{
__warning(ex);
}
//.........这里部分代码省略.........
示例12: increase
void IceExceptionCounter::increase(Ice::Exception& e) {
LOG_INFO("[" << fileName_ << "]-IceExceptionCounter::increase with " << e.what());
increase();
}
示例13:
void
ProxyFlushBatch::handleRetryException(const Ice::Exception& ex)
{
_proxy->__setRequestHandler(_handler, 0); // Clear request handler
ex.ice_throw(); // No retries, we want to notify the user of potentially lost batch requests
}
示例14: ice_exception
virtual void ice_exception(const Ice::Exception& ex)
{
fprintf(stderr, "sayHello AMI called failed:\n%s\n", ex.toString().c_str());
}
示例15: catch
void
IcePHP::convertException(zval* zex, const Ice::Exception& ex)
{
ZVAL_UNDEF(zex);
ostringstream ostr;
ostr << ex;
string str = ostr.str();
try
{
ex.ice_throw();
}
catch(const Ice::LocalException& e)
{
zend_class_entry* cls = idToClass(e.ice_id());
if(cls)
{
if(object_init_ex(zex, cls) != SUCCESS)
{
runtimeError("unable to create exception %s", cls->name->val);
return;
}
if(!convertLocalException(e, zex))
{
return;
}
}
else
{
cls = idToClass("Ice::UnknownLocalException");
assert(cls);
if(object_init_ex(zex, cls) != SUCCESS)
{
runtimeError("unable to create exception %s", cls->name->val);
return;
}
setStringMember(zex, "unknown", str);
}
}
catch(const Ice::UserException&)
{
zend_class_entry* cls = idToClass("Ice::UnknownUserException");
assert(cls);
if(object_init_ex(zex, cls) != SUCCESS)
{
runtimeError("unable to create exception %s", cls->name->val);
return;
}
setStringMember(zex, "unknown", str);
}
catch(const Ice::Exception&)
{
zend_class_entry* cls = idToClass("Ice::UnknownException");
assert(cls);
if(object_init_ex(zex, cls) != SUCCESS)
{
runtimeError("unable to create exception %s", cls->name->val);
return;
}
setStringMember(zex, "unknown", str);
}
return;
}