当前位置: 首页>>代码示例>>C++>>正文


C++ ice::Exception类代码示例

本文整理汇总了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();
 }
开发者ID:lmtoo,项目名称:ice,代码行数:18,代码来源:AllTests.cpp

示例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();
 }
开发者ID:Venom4W,项目名称:ice,代码行数:18,代码来源:AllTests.cpp

示例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();
 }
开发者ID:chenbk85,项目名称:ice,代码行数:19,代码来源:AllTests.cpp

示例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();
 }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:19,代码来源:AllTests.cpp

示例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();
    }
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:19,代码来源:OutgoingAsync.cpp

示例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();
 }
开发者ID:Jonavin,项目名称:ice,代码行数:20,代码来源:AllTests.cpp

示例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());
     }
 }
开发者ID:zmyer,项目名称:ice,代码行数:22,代码来源:AdminI.cpp

示例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();
 }
开发者ID:Jonavin,项目名称:ice,代码行数:23,代码来源:AllTests.cpp

示例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;
    }
}
开发者ID:Jonavin,项目名称:ice,代码行数:62,代码来源:LocatorInfo.cpp

示例10: ice_exception

void AMI_PeraWsAstICE_CreateWSByXpdlStream_I::ice_exception( const Ice::Exception& ex )
{
	SendIceMsg( ex.ice_name().c_str(), "createws" );
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:4,代码来源:PeraWsAstIceClient_I.cpp

示例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);
        }

//.........这里部分代码省略.........
开发者ID:updowndown,项目名称:myffff,代码行数:101,代码来源:Incoming.cpp

示例12: increase

	void IceExceptionCounter::increase(Ice::Exception& e) {
		LOG_INFO("[" << fileName_ << "]-IceExceptionCounter::increase with " << e.what());
		increase();	
	}
开发者ID:xiaoyu-real,项目名称:Test,代码行数:4,代码来源:IceExceptionCounter.cpp

示例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
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:6,代码来源:OutgoingAsync.cpp

示例14: ice_exception

 virtual void ice_exception(const Ice::Exception& ex)
 {
     fprintf(stderr, "sayHello AMI called failed:\n%s\n", ex.toString().c_str());
 }
开发者ID:glockwork,项目名称:dfu,代码行数:4,代码来源:Client.cpp

示例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;
}
开发者ID:ming-hai,项目名称:ice,代码行数:65,代码来源:Util.cpp


注:本文中的ice::Exception类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。