getsentry/raven-js — pull request #55 by avidal (2013-01-14 23:07:20+00:00)
Title: Prevent Raven.captureException re-raising its own exception

Raven.captureException is just an alias for TraceKit.report, but TraceKit.report explicitly re-raises; which will result in the same exception you caught and captured being raised again and bubbling up.

Instead, we can catch that exception again and ignore it if its the same exception that was captured in the first place.