You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemml.apache.org by Deron Eriksson <de...@gmail.com> on 2016/02/29 22:47:02 UTC

DMLRuntimeException

Hi,

Can we change DMLRuntimeException to extend RuntimeException rather than
DMLException?

1) The javadocs say DMLRuntimeException is equivalent to RuntimeException.
RuntimeException is an uncaught exception.
2) However, DMLRuntimeException extends DMLException which extends
Exception which is a caught exception.

So, this means that currently DMLRuntimeException in this example needs a
throws clause on the method (or the throw needs to be wrapped in a
try/catch).

public void example() throws DMLRuntimeException {
throw new DMLRuntimeException("Example");
}
If it's a RuntimeException, it should really be:

public void example() {
throw new DMLRuntimeException("Example");
}

Deron

Re: DMLRuntimeException

Posted by Matthias Boehm <mb...@us.ibm.com>.
thanks Deron for bringing this up. Generally, I'm in favor of this change
since it simplifies our internal APIs. The behavior should not change as
we're already very careful about propagating exceptions all the way up to
the APIs. One important thing, however, is to keep the concatenation of
line numbers to exceptions in place as it is very useful for debugging.

Regards,
Matthias



From:	Deron Eriksson <de...@gmail.com>
To:	dev@systemml.incubator.apache.org
Date:	02/29/2016 01:47 PM
Subject:	DMLRuntimeException



Hi,

Can we change DMLRuntimeException to extend RuntimeException rather than
DMLException?

1) The javadocs say DMLRuntimeException is equivalent to RuntimeException.
RuntimeException is an uncaught exception.
2) However, DMLRuntimeException extends DMLException which extends
Exception which is a caught exception.

So, this means that currently DMLRuntimeException in this example needs a
throws clause on the method (or the throw needs to be wrapped in a
try/catch).

public void example() throws DMLRuntimeException {
throw new DMLRuntimeException("Example");
}
If it's a RuntimeException, it should really be:

public void example() {
throw new DMLRuntimeException("Example");
}

Deron