mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Add experimental APIs to get and clear the last exception
This commit is contained in:
parent
fd3d84ee52
commit
ee36612cef
8 changed files with 150 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue