Exceptions swallowed during evaluation [message #631670] |
Fri, 08 October 2010 08:23  |
Eclipse User |
|
|
|
Hi,
I'm having hard times to debug some OCL expressions in combination of a custom lazy extent map. Most exceptions are neither propagated nor logged in AbstractEvaluationVisitor:
public Object visitExpression(OCLExpression<C> expression) {
try {
return expression.accept(getVisitor());
} catch (EvaluationHaltedException e) {
// evaluation stopped on demand, propagate further
throw e;
} catch (RuntimeException e) {
String msg = e.getLocalizedMessage();
if (msg == null) {
msg = OCLMessages.no_message;
}
OCLPlugin.log(Diagnostic.ERROR, OCLStatusCodes.IGNORED_EXCEPTION_WARNING,
OCLMessages.bind(OCLMessages.EvaluationFailed_ERROR_, msg), e);
// failure to evaluate results in invalid
return getInvalid();
}
}
Note that OCLStatusCodes.IGNORED_EXCEPTION_WARNING even suppresses log output about the exception.
Shouldn't the exception be stored somewhere? E.g. in the result, the visitor, the evaluation environment or where ever. Just somewhere that I can access it after the evaluation has failed.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: Exceptions swallowed during evaluation [message #631846 is a reply to message #631731] |
Sat, 09 October 2010 00:41  |
Eclipse User |
|
|
|
Am 08.10.2010 16:35, schrieb Ed Willink:
> Hi Eike
>
>> Shouldn't the exception be stored somewhere? E.g. in the result, the
>> visitor, the evaluation environment or where ever. Just somewhere that I
>> can access it after the evaluation has failed.
>
> Yes. I've thought about this occasionally, but it's not that high on a much too long list of problems. Please raise a Bugzilla, so that I can't forget or dismiss it as one of my own ramblings.
>
> It's not that easy:
>
> a) OCL defines that there is exactly one invalid.
> b) OCL definjes that a bad evaluation is invalid.
> c) if an expression does ...oclIsInvalid() then invalid wasn't a problem.
> d) EMF throws a variety of RuntimeExceptions
>
> I'm inclined to ignore a) since the uniqueness of invalid isn't sensibly observable, so an invalid-with-context should be feasible.
That'd be my favorite, too ;-)
I've filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=327377 , Preserve exceptions thrown from evaluation
Thank you and
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03415 seconds