MCPcopy Create free account
hub / github.com/FlightGear/flightgear / protect

Method protect

3rdparty/cppunit/src/cppunit/DefaultProtector.cpp:6–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6CPPUNIT_NS_BEGIN
7
8
9bool
10DefaultProtector::protect( const Functor &functor,
11 const ProtectorContext &context )
12{
13 try
14 {
15 return functor();
16 }
17 catch ( Exception &failure )
18 {
19 reportFailure( context, failure );
20 }
21 catch ( std::exception &e )
22 {
23 std::string shortDescription( "uncaught exception of type " );
24#if defined(CPPUNIT_USE_TYPEINFO_NAME)
25 shortDescription += TypeInfoHelper::getClassName( typeid(e) );
26#else
27 shortDescription += "std::exception (or derived).";
28#endif
29 Message message( shortDescription, e.what() );
30 reportError( context, message );
31 }
32 catch ( ... )
33 {
34 reportError( context,
35 Message( "uncaught exception of unknown type") );
36 }
37
38 return false;
39}
40
41
42CPPUNIT_NS_END

Callers

nothing calls this directly

Calls 2

MessageClass · 0.50
whatMethod · 0.45

Tested by

no test coverage detected