From 8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 10 Oct 2012 16:00:58 +0200 Subject: Improved tracing of failures, user exceptions are now tracked with a userException member. --- cpp/src/slice2java/Gen.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cpp/src/slice2java/Gen.cpp') diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 666e23f1104..c9f7f42e243 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4524,8 +4524,10 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(op->returnsData()) { out << nl << "Ice.AsyncResult.__check(__result, this, __" << op->name() << "_name);"; - out << nl; - out << "if(!__result.__wait())"; + out << nl << "boolean __ok = __result.__wait();"; + out << nl << "try"; + out << sb; + out << nl << "if(!__ok)"; out << sb; out << nl << "try"; out << sb; @@ -4587,6 +4589,17 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) out << nl << "return __ret;"; } } + + out << eb; + out << nl << "catch(Ice.LocalException ex)"; + out << sb; + out << nl << "Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();"; + out << nl << "if(__obsv != null)"; + out << sb; + out << nl << "__obsv.failed(ex.ice_name());"; + out << eb; + out << nl << "throw ex;"; + out << eb; } else { -- cgit v1.2.3