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
This commit is contained in:
parent
f6b2909aad
commit
829b8bccc3
1 changed files with 10 additions and 6 deletions
|
@ -351,7 +351,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
break;
|
break;
|
||||||
case XMLRPC:
|
case XMLRPC:
|
||||||
try {
|
try {
|
||||||
localrtx.begin (app.getName()+":xmlrpc/"+method);
|
localrtx.begin (app.getName()+":xmlrpc:"+method);
|
||||||
|
|
||||||
root = app.getDataRoot ();
|
root = app.getDataRoot ();
|
||||||
|
|
||||||
|
@ -386,23 +386,25 @@ public final class RequestEvaluator implements Runnable {
|
||||||
result = scriptingEngine.invoke (currentElement, method, args, true);
|
result = scriptingEngine.invoke (currentElement, method, args, true);
|
||||||
commitTransaction ();
|
commitTransaction ();
|
||||||
|
|
||||||
} catch (Exception wrong) {
|
} catch (Exception x) {
|
||||||
|
|
||||||
abortTransaction (false);
|
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
|
// If the transactor thread has been killed by the invoker thread we don't have to
|
||||||
// bother for the error message, just quit.
|
// bother for the error message, just quit.
|
||||||
if (localrtx != rtx) {
|
if (localrtx != rtx) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.exception = wrong;
|
this.exception = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case INTERNAL:
|
case INTERNAL:
|
||||||
// Just a human readable descriptor of this invocation
|
// 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 is an instance of NodeHandle, get the node object itself.
|
||||||
if (thisObject != null && thisObject instanceof NodeHandle) {
|
if (thisObject != null && thisObject instanceof NodeHandle) {
|
||||||
|
@ -438,17 +440,19 @@ public final class RequestEvaluator implements Runnable {
|
||||||
result = scriptingEngine.invoke (thisObject, method, args, false);
|
result = scriptingEngine.invoke (thisObject, method, args, false);
|
||||||
commitTransaction ();
|
commitTransaction ();
|
||||||
|
|
||||||
} catch (Exception wrong) {
|
} catch (Exception x) {
|
||||||
|
|
||||||
abortTransaction (false);
|
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
|
// If the transactor thread has been killed by the invoker thread we don't have to
|
||||||
// bother for the error message, just quit.
|
// bother for the error message, just quit.
|
||||||
if (localrtx != rtx) {
|
if (localrtx != rtx) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.exception = wrong;
|
this.exception = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue