use of php.runtime.lang.BaseException in project jphp by jphp-compiler.
the class ErrorHandler method onError.
public boolean onError(Environment env, SystemMessage message) {
if (ErrorType.check(errorHandlerFlags, message.getType())) {
TraceInfo trace = message.getTrace().trace;
int argCount = invoker.getArgumentCount();
if (argCount < 4)
argCount = 4;
else if (argCount > 5)
argCount = 5;
Memory[] args = new Memory[argCount];
args[0] = LongMemory.valueOf(message.getType().value);
args[1] = new StringMemory(message.getMessage());
args[2] = new StringMemory(trace.getFileName());
args[3] = LongMemory.valueOf(trace.getStartLine() + 1);
if (argCount > 4)
args[4] = new ArrayMemory(false, message.getTrace().args);
try {
invoker.setTrace(null);
return (invoker.call(args).toValue() != Memory.FALSE);
} catch (ErrorException e) {
throw e;
} catch (BaseException e) {
throw e;
} catch (DieException e) {
throw e;
} catch (Throwable throwable) {
throw new RuntimeException(throwable);
}
}
return false;
}
Aggregations