deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Porter <lightguard...@gmail.com>
Subject Re: ExceptionHandler root cause is the only one thrown?
Date Mon, 02 Mar 2015 14:42:33 GMT
The exception chain is unwrapped first before sending it to any handlers. A
generic Exception handler usually is pretty useless.

You could add some logic into it to skip it if the type is a
ConnectionException.

You could also create a BeforeHandler (use the annotations) for your
SolrException, that should be called before your generic Exception handler.

On Sunday, March 1, 2015, Karl Kildén <karl.kilden@gmail.com> wrote:

> Hello,
>
> I have a typical use case I can't figure out what I might misunderstand. I
> have a java.net.ConnectException as root exception. This is wrapped by
> SolrServerException. I want my handler on SolrServerException because the
> ConnectionException is to broad and I can't draw any conclusions. However
> the SolrServerException is easy to parse and print a good message to the
> end user.
>
> Problem is I have a general dump Handler that takes Exception and redirects
> to error page. This is where my exception ends up BEFORE  handler that
> takes SolrServerException. I want it to try to whole chain up to the outer
> cause before going to my handler that takes Exception...
>
> Cheers
>


-- 
Jason Porter
http://en.gravatar.com/lightguardjp

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message