Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed blockless Raven#capture #320

Merged
merged 3 commits into from
Apr 16, 2015
Merged

Fixed blockless Raven#capture #320

merged 3 commits into from
Apr 16, 2015

Conversation

DaveWillkomm
Copy link

#272 introduced bugs into the blockless semantics of #capture.

  • Fixed #capture to not yield when no block given
  • Fixed #capture to pass options to #install_at_exit_hook
  • Fixed #install_at_exit_block to check for the existence of $ERROR_INFO

Dave Willkomm added 3 commits April 15, 2015 07:55
* Specifically covering the at exit hook and block yield functionality
* Fixed #capture to not yield when no block given
* Fixed #capture to pass options to #install_at_exit_hook
* Fixed #install_at_exit_block to check for the existence of $ERROR_INFO
@nateberkopec
Copy link
Contributor

Hmm, obviously we never considered that people would use #capture this way.

Can you give me an example of how/why you're using #capture without a block?

@DaveWillkomm
Copy link
Author

#capture is documented as processing exceptions globally if no block is given. Isn't that why an at_exit handler is registered when no block is given?

We want to capture exceptions globally, so Instead of repeating Raven configuration and startup code in all of our applications' start scripts, they require a sharable raven_init.rb file which performs these functions. The global exception processing makes this pretty slick.

require 'raven'
Raven.configure { |config| config.should_send = ->(_) { !!ENV['SENTRY_DSN'] } }
Raven.capture

@nateberkopec
Copy link
Contributor

Thanks! I'm just unfamiliar with this usage because I'm always using Sentry with Rack middleware.

nateberkopec added a commit that referenced this pull request Apr 16, 2015
@nateberkopec nateberkopec merged commit 7fe61c2 into getsentry:master Apr 16, 2015
@DaveWillkomm
Copy link
Author

Thanks, @nateberkopec!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants