From 829b8bccc3361ec0f83decc03f420605fede0165 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 13 Jan 2003 12:40:44 +0000 Subject: [PATCH] Log to the event log when an internal scheduler or XML-RPC invoked function throws an exception Fixes bug 196, http://helma.org/bugs/show_bug.cgi?id=196 --- src/helma/framework/core/RequestEvaluator.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 17f97d0e..a7dbb0dd 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -351,7 +351,7 @@ public final class RequestEvaluator implements Runnable { break; case XMLRPC: try { - localrtx.begin (app.getName()+":xmlrpc/"+method); + localrtx.begin (app.getName()+":xmlrpc:"+method); root = app.getDataRoot (); @@ -386,23 +386,25 @@ public final class RequestEvaluator implements Runnable { result = scriptingEngine.invoke (currentElement, method, args, true); commitTransaction (); - } catch (Exception wrong) { + } catch (Exception x) { abortTransaction (false); + app.logEvent ("Exception in "+Thread.currentThread()+": "+x); + // If the transactor thread has been killed by the invoker thread we don't have to // bother for the error message, just quit. if (localrtx != rtx) { return; } - this.exception = wrong; + this.exception = x; } break; case INTERNAL: // Just a human readable descriptor of this invocation - String funcdesc = app.getName()+":internal/"+method; + String funcdesc = app.getName()+":internal:"+method; // if thisObject is an instance of NodeHandle, get the node object itself. if (thisObject != null && thisObject instanceof NodeHandle) { @@ -438,17 +440,19 @@ public final class RequestEvaluator implements Runnable { result = scriptingEngine.invoke (thisObject, method, args, false); commitTransaction (); - } catch (Exception wrong) { + } catch (Exception x) { abortTransaction (false); + app.logEvent ("Exception in "+Thread.currentThread()+": "+x); + // If the transactor thread has been killed by the invoker thread we don't have to // bother for the error message, just quit. if (localrtx != rtx) { return; } - this.exception = wrong; + this.exception = x; } break;