Add experimental APIs to get and clear the last exception

This commit is contained in:
Sam Ruby 2000-07-08 10:35:50 +00:00
parent fd3d84ee52
commit ee36612cef
8 changed files with 150 additions and 2 deletions

View file

@ -88,12 +88,23 @@ public class reflect {
}
}
static Throwable lastException = null;
static void lastException(long result) {
setResult(result, lastException);
}
static void clearException() {
lastException = null;
}
static void setException(long result, Throwable e) {
if (e instanceof InvocationTargetException) {
Throwable t = ((InvocationTargetException)e).getTargetException();
if (t!=null) e=t;
}
lastException = e;
setException(result, e.toString().getBytes());
}