PDA

View Full Version : [Mondrian] catching Error and ignoring



Richard Emberson
04-23-2007, 03:00 PM
Just looking through the code and noticed that
RolapResult (about line 922) has the following:

} catch (ResultLimitExceededException e) {
// Do NOT ignore a ResultLimitExceededException!!!
throw e;

} catch (MondrianEvaluationException e) {
// ignore

} catch (Throwable e) {
Util.discard(e);
}


Catches a Throwable and ignores it. Now Errors are JVM
fatal conditions. Should we be ignoring Errors?

Richard


--
Quis custodiet ipsos custodes:
This email message is for the sole use of the intended recipient(s) and
may contain confidential information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies of the original message.
_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

Julian Hyde
04-23-2007, 05:20 PM
I agree. I would re-throw any Errors. Leave the Util.discard - it is a
good practice if you are going to throw away an exception.

Hence:

} catch (ResultLimitExceededException e) {
// Do NOT ignore a ResultLimitExceededException!!!
throw e;
} catch (MondrianEvaluationException e) {
// ignore
} catch (Error e) {
// Errors indicate fatal JVM problems; do not
discard
throw e;
} catch (Throwable e) {
// Discard non-fatal exceptions.
Util.discard(e);
}

Julian

> -----Original Message-----
> From: mondrian-bounces (AT) pentaho (DOT) org
> [mailto:mondrian-bounces (AT) pentaho (DOT) org] On Behalf Of Richard Emberson
> Sent: Monday, April 23, 2007 12:03 PM
> To: mondrian (AT) pentaho (DOT) org
> Subject: [Mondrian] catching Error and ignoring
>
>
> Just looking through the code and noticed that
> RolapResult (about line 922) has the following:
>
> } catch (ResultLimitExceededException e) {
> // Do NOT ignore a
> ResultLimitExceededException!!!
> throw e;
>
> } catch (MondrianEvaluationException e) {
> // ignore
>
> } catch (Throwable e) {
> Util.discard(e);
> }
>
>
> Catches a Throwable and ignores it. Now Errors are JVM
> fatal conditions. Should we be ignoring Errors?
>
> Richard
>
>
> --
> Quis custodiet ipsos custodes:
> This email message is for the sole use of the intended
> recipient(s) and
> may contain confidential information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all
> copies of the original message.
> _______________________________________________
> Mondrian mailing list
> Mondrian (AT) pentaho (DOT) org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian