envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Log unhandled exceptions to configured application block #209

Closed orien closed 6 years ago

orien commented 6 years ago

Context

We've been trying to track down an exception that's been killing our process. Rather than sifting through the logs it'd be nice to see this error in Rollbar.

Change

Handle uncaught exceptions with the application configured block. (In our case it logs to Rollbar.)

stevehodgkiss commented 6 years ago

I think this will likely result in duplicate error reports if Rollbar is installed (and ESPRunner is invoked from rake) because Rollbar automatically instruments rake to report errors, and these errors would be raised up to the rake level and end the process.

orien commented 6 years ago

@stevehodgkiss That's a good point. How about we introduce another configuration option for this case? Perhaps on_event_processor_critical_error:

  config.on_event_processor_critical_error = proc { |exception, processor_name| …