diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-10 16:00:58 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-10 16:00:58 +0200 |
commit | 8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4 (patch) | |
tree | 1cdcd88fccb57f88d2b47cd1757b4d43bc05be4b /cpp/src/slice2java/Gen.cpp | |
parent | Added IceGridGUI IceStorm metrics (diff) | |
download | ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.tar.bz2 ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.tar.xz ice-8bcfc9e4a8a1de3d72e30ffc6f3c9d72a8d3f0e4.zip |
Improved tracing of failures, user exceptions are now tracked
with a userException member.
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
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 { |