defaultprotector.cpp
来自「这是国外的resip协议栈」· C++ 代码 · 共 43 行
CPP
43 行
#include <cppunit/Exception.h>#include <cppunit/extensions/TypeInfoHelper.h>#include "DefaultProtector.h"CPPUNIT_NS_BEGINbool DefaultProtector::protect( const Functor &functor, const ProtectorContext &context ){ try { return functor(); } catch ( Exception &failure ) { reportFailure( context, failure ); } catch ( std::exception &e ) { std::string shortDescription( "uncaught exception of type " );#if CPPUNIT_USE_TYPEINFO_NAME shortDescription += TypeInfoHelper::getClassName( typeid(e) );#else shortDescription += "std::exception (or derived).";#endif Message message( shortDescription, e.what() ); reportError( context, message ); } catch ( ... ) { reportError( context, Message( "uncaught exception of unknown type") ); } return false;}CPPUNIT_NS_END
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?