How to exclude certain exceptions (not just ignore them)

phylae's Avatar

phylae

28 Jun, 2011 07:08 PM

I'm using the service with some background ruby processes that involve forking lots of child processes. It looks something like this:

Process.fork do
  Exceptional.rescue_and_reraise do
    # stuff
  end
end

The child processes are typically stopped by trapping a signal and running exit. Running exit raises a SystemExit exception. This gets rescued by getexceptional. Since I have have a lot of background processes, which often last only seconds or minutes, I am getting 1000s of exceptions in my account. (I'm over 40,000 right now.) I know I can just mark these as ignored. But it is really inefficient to be sending all of this unnecessary exception data. I never want getexceptional to rescue a SystemExit exception. Is there a way to have getexceptional ignore certain errors?

I know I could monkeypatch the gem (i.e. just change this one line: https://github.com/contrast/exceptional/blob/master/lib/exceptional...). But I'd rather stay with the official gem.

If I wrote a patch to make this a configurable option, would you accept that? Maybe Exceptional.rescue_and_reraise could accept an optional argument that is an array of Exception classes that will (or won't?) be rescued.

  1. 1 Posted by Joshua Ballanco on 05 Jul, 2011 12:43 PM

    Joshua Ballanco's Avatar

    Hi,

    We definitely do accept pull requests against the Exceptional gem. That said, allowing a certain class of exceptions to be ignored sounds like it would be a good feature, and we'll add that to our queue of feature requests.

    Cheers,

    Josh

  2. 2 Posted by Robert on 15 Feb, 2013 10:05 PM

    Robert's Avatar

    Hi, this is Robert with support, I am clearing out old tickets. If you are still having issues with this, send an email to [email blocked].

    Thanks,
    Robert

  3. Robert closed this discussion on 15 Feb, 2013 10:05 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac