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

Move rescued types to a constant #69

Merged
merged 1 commit into from
Aug 22, 2017
Merged

Move rescued types to a constant #69

merged 1 commit into from
Aug 22, 2017

Conversation

jbarnette
Copy link
Contributor

This PR addresses (but doesn't close) #60. Right now, Observation rescues Object when it calls a behavior block. This can be pretty surprising, especially if an unhandled signal or a SystemExit is raised inside the block.

The patch introduces a Scientist::Observation::RESCUES constant with a value of [Exception]. This set of exceptions is used to rescue instead of a hardcoded Object. I think we should switch the default value to [StandardError] in 2.0.0, here's how to do it in the meantime:

Scientist::Observation::RESCUES.replace [StandardError]

/cc @djrodgerspryor @strand
/cc @jesseplusplus, who doesn't show up in the reviewer list

@jbarnette jbarnette self-assigned this Aug 11, 2017
@jbarnette jbarnette mentioned this pull request Aug 11, 2017
Copy link

@johana-star johana-star left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clearly written, and a pretty elegant seam to use for customization.

@djrodgerspryor
Copy link

👍 This seems like an excellent migration plan

Copy link
Member

@zerowidth zerowidth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 makes sense to me. Good path for 2.0.0 too.

@jbarnette jbarnette merged commit 042cd55 into master Aug 22, 2017
@jbarnette jbarnette deleted the configurable-rescues branch August 22, 2017 22:17
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.

4 participants