Call std::exit for unhandled exceptions

This commit is contained in:
Vinnie Falco
2013-09-26 15:11:23 -07:00
parent 985af0e222
commit d683b47dee
3 changed files with 23 additions and 3 deletions

View File

@@ -81,8 +81,8 @@
are thrown.
@see ProtectedCall
*/
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
#endif
//------------------------------------------------------------------------------

View File

@@ -17,6 +17,22 @@
*/
//==============================================================================
RippleMain::RippleMain()
{
ProtectedCall::setHandler (*this);
}
RippleMain::~RippleMain()
{
}
void RippleMain::onException (ProtectedCall::Exception const& e) const
{
std::_Exit(EXIT_FAILURE);
}
//------------------------------------------------------------------------------
namespace po = boost::program_options;

View File

@@ -21,9 +21,13 @@
#ifndef RIPPLE_RIPPLEMAIN_H_INCLUDED
#define RIPPLE_RIPPLEMAIN_H_INCLUDED
class RippleMain : public Main
class RippleMain : public Main, public ProtectedCall::Handler
{
public:
RippleMain ();
~RippleMain ();
void onException (ProtectedCall::Exception const& e) const;
int run (int argc, char const* const* argv);
};