From 3b6ea029201fe9ade39c8a3cca857e1f6b493480 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 1 Jul 2015 16:30:50 -0700 Subject: [PATCH] Fix missing tefEXCEPTION handling in apply --- src/ripple/app/tx/impl/apply.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/ripple/app/tx/impl/apply.cpp b/src/ripple/app/tx/impl/apply.cpp index 0725a3615e..a2759d9d0e 100644 --- a/src/ripple/app/tx/impl/apply.cpp +++ b/src/ripple/app/tx/impl/apply.cpp @@ -77,10 +77,25 @@ std::pair apply (BasicView& view, STTx const& tx, ViewFlags flags, Config const& config, - beast::Journal journal) + beast::Journal j) { - return invoke (tx.getTxnType(), - view, tx, flags, config, journal); + try + { + return invoke (tx.getTxnType(), + view, tx, flags, config, j); + } + catch(std::exception const& e) + { + JLOG(j.fatal) << + "Caught exception: " << e.what(); + return { tefEXCEPTION, false }; + } + catch(...) + { + JLOG(j.fatal) << + "Caught unknown exception"; + return { tefEXCEPTION, false }; + } } } // ripple