|
@@ -561,8 +561,8 @@ func (rt *tryRuntime) Eval(vs parser.Scope, is map[string]interface{}, tid uint6
|
|
|
|
|
|
for i := 1; i < len(rt.node.Children); i++ {
|
|
|
if child := rt.node.Children[i]; child.Name == parser.NodeEXCEPT {
|
|
|
- if rt.evalExcept(vs, is, tid, errObj, child) {
|
|
|
- err = nil
|
|
|
+ if ok, newerror := rt.evalExcept(vs, is, tid, errObj, child); ok {
|
|
|
+ err = newerror
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -574,7 +574,8 @@ func (rt *tryRuntime) Eval(vs parser.Scope, is map[string]interface{}, tid uint6
|
|
|
}
|
|
|
|
|
|
func (rt *tryRuntime) evalExcept(vs parser.Scope, is map[string]interface{},
|
|
|
- tid uint64, errObj map[interface{}]interface{}, except *parser.ASTNode) bool {
|
|
|
+ tid uint64, errObj map[interface{}]interface{}, except *parser.ASTNode) (bool, error) {
|
|
|
+ var newerror error
|
|
|
ret := false
|
|
|
|
|
|
if len(except.Children) == 1 {
|
|
@@ -583,7 +584,7 @@ func (rt *tryRuntime) evalExcept(vs parser.Scope, is map[string]interface{},
|
|
|
|
|
|
evs := vs.NewChild(scope.NameFromASTNode(except))
|
|
|
|
|
|
- except.Children[0].Runtime.Eval(evs, is, tid)
|
|
|
+ _, newerror = except.Children[0].Runtime.Eval(evs, is, tid)
|
|
|
|
|
|
ret = true
|
|
|
|
|
@@ -594,7 +595,7 @@ func (rt *tryRuntime) evalExcept(vs parser.Scope, is map[string]interface{},
|
|
|
evs := vs.NewChild(scope.NameFromASTNode(except))
|
|
|
evs.SetValue(except.Children[0].Token.Val, errObj)
|
|
|
|
|
|
- except.Children[1].Runtime.Eval(evs, is, tid)
|
|
|
+ _, newerror = except.Children[1].Runtime.Eval(evs, is, tid)
|
|
|
|
|
|
ret = true
|
|
|
|
|
@@ -623,12 +624,12 @@ func (rt *tryRuntime) evalExcept(vs parser.Scope, is map[string]interface{},
|
|
|
evs.SetValue(errorVar, errObj)
|
|
|
}
|
|
|
|
|
|
- child.Runtime.Eval(evs, is, tid)
|
|
|
+ _, newerror = child.Runtime.Eval(evs, is, tid)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return ret
|
|
|
+ return ret, newerror
|
|
|
}
|
|
|
|
|
|
// Mutex Runtime
|