OgnlExpression now unwraps the ognl.OgnlException to make the real exception available to the caller (SWF-255).
This commit is contained in:
@@ -74,7 +74,14 @@ class OgnlExpression implements SettableExpression {
|
||||
return Ognl.getValue(expression, contextAttributes, target);
|
||||
}
|
||||
catch (OgnlException e) {
|
||||
throw new EvaluationException(new EvaluationAttempt(this, target, context), e);
|
||||
if (e.getReason() != null && e.getReason() != e) {
|
||||
// unwrap the OgnlException since the actual exception is wrapped inside it
|
||||
// and there is not generic (getCause) way to get to it later on
|
||||
throw new EvaluationException(new EvaluationAttempt(this, target, context), e.getReason());
|
||||
}
|
||||
else {
|
||||
throw new EvaluationException(new EvaluationAttempt(this, target, context), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user