You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Andy Grove <an...@agildata.com> on 2015/10/22 23:29:15 UTC

Exception handling conventions

I started adding error checks in RelBuilder, specifically adding NULL
checks when looking up tables.

There are some options for exception reporting and I wanted to get a feel
for preferred approach.

I saw that there is already an InvalidRelException, which seemed pretty
appropriate, but it is a checked exception, so means method signatures have
to be changed. This seemed too disruptive,

We could make this an unchecked exception?

Otherwise is there some generic exception class I should use, or maybe just
use IllegalArgumentException / IllegalStateException / RuntimeException ?

Thanks,

Andy.

--

Andy Grove
Chief Architect
AgilData - Simple Streaming SQL that Scales
www.agildata.com

Re: Exception handling conventions

Posted by Julian Hyde <jh...@apache.org>.
Don't use InvalidRelException - it has a specific, different, purpose.

I agree go with unchecked. IllegalArgumentException sounds about right
but I don't feel strongly. And of course NullPointerException if they
pass null.

On Thu, Oct 22, 2015 at 2:29 PM, Andy Grove <an...@agildata.com> wrote:
> I started adding error checks in RelBuilder, specifically adding NULL
> checks when looking up tables.
>
> There are some options for exception reporting and I wanted to get a feel
> for preferred approach.
>
> I saw that there is already an InvalidRelException, which seemed pretty
> appropriate, but it is a checked exception, so means method signatures have
> to be changed. This seemed too disruptive,
>
> We could make this an unchecked exception?
>
> Otherwise is there some generic exception class I should use, or maybe just
> use IllegalArgumentException / IllegalStateException / RuntimeException ?
>
> Thanks,
>
> Andy.
>
> --
>
> Andy Grove
> Chief Architect
> AgilData - Simple Streaming SQL that Scales
> www.agildata.com