Custom catch-all exception handler

31 views
Skip to first unread message

Christoph Dietze

unread,
Feb 13, 2014, 2:59:03 PM2/13/14
to pl...@googlegroups.com
Hi,

I would like to add some additional / custom reporting in case an unexpected Exception is thrown.

However, for exceptions triggered by UI events it looks like the catch-all exception handler is hard wired in playn.core.Dispatcher#tryInteract:

  static <L, E extends Input.Impl> void tryInteract (AbstractLayer layer,
     
Class<L> listenerType, Interaction<L, E> interaction, E event) {
   
try {
      layer
.interact(listenerType, interaction, event);
   
} catch (Throwable t) {
     
PlayN.log().warn("Interaction failure [layer=" + layer + ", iact=" + interaction +
       
", event=" + event + "]", t);
   
}
 
}

Is there some way to supply custom handling that I am missing?

Otherwise I'd patch the Dispatcher.

Michael Bayne

unread,
Feb 13, 2014, 4:38:40 PM2/13/14
to pl...@googlegroups.com
On Thu, Feb 13, 2014 at 11:59 AM, Christoph Dietze
<christop...@gmail.com> wrote:
> Is there some way to supply custom handling that I am missing?

There isn't, but you make a good case for such a mechanism existing. I
shall attempt to make it so.

-- m...@samskivert.com

Michael Bayne

unread,
Feb 17, 2014, 2:25:05 PM2/17/14
to pl...@googlegroups.com
On Thu, Feb 13, 2014 at 1:38 PM, Michael Bayne <m...@samskivert.com> wrote:
> There isn't, but you make a good case for such a mechanism existing. I
> shall attempt to make it so.

It is so:

https://github.com/threerings/playn/commit/37ffeb5610ac640cde6d0f40531d04fae06997b9

-- m...@samskivert.com

Christoph Dietze

unread,
Feb 17, 2014, 6:42:24 PM2/17/14
to pl...@googlegroups.com
Wonderful, thanks!
Reply all
Reply to author
Forward
0 new messages