users@grizzly.java.net

Re: Grizzly 2.2.2 WebSocket implementation catches all exceptions without letting the user know

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Mon, 11 Jun 2012 08:42:59 -0700

Please log an issue and we'll look into it.

Thanks!

On 6/11/12 5:46 AM, justphilmusic_at_googlemail.com wrote:
> Hello everybody,
>
> I'm about to write an application that is based on Grizzly's WebSocket
> implementation and I realized that it is a pain to debug my own
> application due to the fact that the WebSocket implementation catches
> all exceptions that are thrown in my code, without giving me a hint
> that an exception has actually been thrown.
>
> Consider the following WebSocketApplication sub class:
>
>
> public class MyApplication extends WebSocketApplication {
>
> // other overridden methods that are omitted for brevity reasons
>
> @Override
> public void onMessage(WebSocket socket, String data) {
>
> assert false : "this is unfortunately catched by
> grizzly";
>
> throw new RuntimeException("and this one also");
>
> }
>
> }
>
>
> As an API user I never get to know that something went wrong without
> explicitly catching these exceptions by myself. That's obviously not
> that cool because e.g. it is not possible to use Java's assertion
> mechanism anymore.
>
> This behavior can be spotted in Grizzly 2.2.2. I haven't tested any
> newer versions yet.
>
>
> So, is this actually expected behavior? Is there a possibility to tell
> Grizzly NOT to drive the "catch all" policy?
>
>
> Thanks in advance!
>
> Philipp