Added capture_exceptions decorator

This decorator will automatically call captureException() if the function
raises an Exception, then reraises it.