Quantcast

platform-core error handling in event handlers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

platform-core error handling in event handlers

Göran Ehrsson
Hi,

I recently started to use events with the platform-core plugin and it's a joy to use! (compared to spring-events).
But... when an exception is thrown in a event handler/subscriber, it is silently ignored. Nothing shows up in logs, etc.
Is this by design? Is there a log category I need to configure to see the exception?
I know I need proper error handling in my event handlers, but it's very easy to miss problems when exceptions are silently ignored.

Regards

/Göran Ehrsson
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: platform-core error handling in event handlers

smaldini
Hi

Thank you for your feedback !
No its not by design. There is a problem somewhere, can you try to add an on onError parameter to your event call (or your DSL event definition) ?

events = {
  '*' onError:{ println it }
}

or 

event topic:'test', data:data, onError: { println it }

Cheers


On Thu, Aug 16, 2012 at 8:03 PM, Göran Ehrsson <[hidden email]> wrote:
Hi,

I recently started to use events with the platform-core plugin and it's a joy to use! (compared to spring-events).
But... when an exception is thrown in a event handler/subscriber, it is silently ignored. Nothing shows up in logs, etc.
Is this by design? Is there a log category I need to configure to see the exception?
I know I need proper error handling in my event handlers, but it's very easy to miss problems when exceptions are silently ignored.

Regards

/Göran Ehrsson



--
Stéphane MALDINI
--


Loading...