Skip to content

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 requested review from rick and zerowidth August 11, 2017 18:52
@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
Contributor

@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.

7 participants