On 2010/06/23 16:55:47, janluehe wrote:
We override setRequestHeaders to add some product-specific headers,
and when
determining their values, checked exceptions may be thrown. Currently,
we have
to log them as severe errors, but we'd really like to be able to wrap
them
inside GadgetException and have ProxyBase#outputError take care of
producing an
error response.
On 2010/06/23 16:36:35, gagan.goku wrote:
> On 2010/06/23 16:05:22, janluehe wrote:
> >
>
> Do you want to wrap an inner exception into GadgetException?
> Currently there doesn't seem to be anything in setRequestHeaders
that can
throw
> an exception. If you have a case where some null pointer exception
etc is
> returned, then this change makes sense.
Your use case sounds good to me.
But you can also do this:
static class A {
protected void hello() {
throw new NullPointerException("hello");
}
}
static class B extends A {
public void hello1() throws GadgetException {
try {
super.hello();
} catch (Exception e) {
e.printStackTrace();
throw new GadgetException(e);
}
}
}
http://codereview.appspot.com/1683050/show