|
@@ -3,6 +3,7 @@ package org.ssssssss.script.parsing.ast;
|
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
import org.ssssssss.script.MagicScriptContext;
|
|
import org.ssssssss.script.MagicScriptContext;
|
|
import org.ssssssss.script.MagicScriptError;
|
|
import org.ssssssss.script.MagicScriptError;
|
|
|
|
+import org.ssssssss.script.exception.ScriptException;
|
|
import org.ssssssss.script.interpreter.AbstractReflection;
|
|
import org.ssssssss.script.interpreter.AbstractReflection;
|
|
import org.ssssssss.script.interpreter.AstInterpreter;
|
|
import org.ssssssss.script.interpreter.AstInterpreter;
|
|
import org.ssssssss.script.parsing.Span;
|
|
import org.ssssssss.script.parsing.Span;
|
|
@@ -96,7 +97,7 @@ public class MemberAccess extends Expression {
|
|
MethodCall methodCall = new MethodCall(getName(), access, Collections.emptyList());
|
|
MethodCall methodCall = new MethodCall(getName(), access, Collections.emptyList());
|
|
try {
|
|
try {
|
|
return methodCall.evaluate(context);
|
|
return methodCall.evaluate(context);
|
|
- } catch (MagicScriptError.ScriptException e) {
|
|
+ } catch (ScriptException e) {
|
|
if (ExceptionUtils.indexOfThrowable(e, InvocationTargetException.class) > -1) {
|
|
if (ExceptionUtils.indexOfThrowable(e, InvocationTargetException.class) > -1) {
|
|
MagicScriptError.error(String.format("在%s中调用方法get%s发生异常"
|
|
MagicScriptError.error(String.format("在%s中调用方法get%s发生异常"
|
|
, object.getClass()
|
|
, object.getClass()
|
|
@@ -107,7 +108,7 @@ public class MemberAccess extends Expression {
|
|
methodCall = new MethodCall(getName(), access, Arrays.asList(new StringLiteral(getName())));
|
|
methodCall = new MethodCall(getName(), access, Arrays.asList(new StringLiteral(getName())));
|
|
try {
|
|
try {
|
|
return methodCall.evaluate(context);
|
|
return methodCall.evaluate(context);
|
|
- } catch (MagicScriptError.ScriptException e3) {
|
|
+ } catch (ScriptException e3) {
|
|
if (ExceptionUtils.indexOfThrowable(e3, InvocationTargetException.class) > -1) {
|
|
if (ExceptionUtils.indexOfThrowable(e3, InvocationTargetException.class) > -1) {
|
|
MagicScriptError.error(String.format("在%s中调用方法get发生异常"
|
|
MagicScriptError.error(String.format("在%s中调用方法get发生异常"
|
|
, object.getClass()
|
|
, object.getClass()
|
|
@@ -118,7 +119,7 @@ public class MemberAccess extends Expression {
|
|
methodCall = new MethodCall(getName(), access, Collections.emptyList());
|
|
methodCall = new MethodCall(getName(), access, Collections.emptyList());
|
|
try {
|
|
try {
|
|
return methodCall.evaluate(context);
|
|
return methodCall.evaluate(context);
|
|
- } catch (MagicScriptError.ScriptException e1) {
|
|
+ } catch (ScriptException e1) {
|
|
if (ExceptionUtils.indexOfThrowable(e1, InvocationTargetException.class) > -1) {
|
|
if (ExceptionUtils.indexOfThrowable(e1, InvocationTargetException.class) > -1) {
|
|
MagicScriptError.error(String.format("在%s中调用方法is%s发生异常"
|
|
MagicScriptError.error(String.format("在%s中调用方法is%s发生异常"
|
|
, object.getClass()
|
|
, object.getClass()
|