circleci / rollcage

A Clojure client for Rollbar
Eclipse Public License 1.0
51 stars 28 forks source link

Add ability to specify reporting fn for uncaught exs #11

Closed smaant closed 7 years ago

smaant commented 7 years ago

Custom reporting function will allow having more control over uncaught exceptions. For instance, log them.

gordonsyme commented 7 years ago

~ I think maybe being able to pass middleware to wrap the standard rollbar-reporting fn would be neater. It'd be odd to have a rollbar library you can configure to not send to rollbar.

smaant commented 7 years ago

@gordonsyme why not? You may want to do it for some environments, for example.

marcomorain commented 7 years ago

The code in 9df9ff7 doesn't allow you to intercept all events that are being sent to Rollcage, just the ones from the uncaught exception handler - this seems strange to me.

What's use-case here? Is the aim to log uncaught exceptions from an app? If yes, then why not just install an uncaught exception handler in the app that logs (and build a chain like here).

Otherwise, it might make sense to add a callback/middleware type function to the client that is called before any event is sent to Rollcage.

smaant commented 7 years ago

@marcomorain well, other events are generated by my code, so under my control by definition. My particular use case to also log exceptions and be able to don't send anything from tests. I don't really see how callbacks/middleware is simpler or better than just passing a function.