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

Simplify run methods #119

Merged
merged 2 commits into from
Dec 26, 2018
Merged

Conversation

matthewshafer
Copy link
Collaborator

@matthewshafer matthewshafer commented Dec 7, 2018

Circuitbox's run method rescues exceptions to return nil. Raising / rescuing these exceptions to return nil is pretty expensive. By switching run to take the keyword arg circuitbox_exceptions we don't need to raise exceptions just to return nil on failure.

This is a breaking change, but this is going in with a major version bump.

…ting circuitbox_exceptions to false. In this case the new run method would act like the old run method, returning nil if these errors would have been encountered.
…n exception after we've store the response. This becomes a problem if if the exception that is raised is one that circuitbox is tracking. If circuitbox_exceptions is false and this were to happen the response would be the return value of the block. This keeps the behavior of the previous implementation of run.
@matthewshafer matthewshafer merged commit a9da1a3 into yammer:master Dec 26, 2018
@matthewshafer matthewshafer deleted the simplify-run-methods branch December 26, 2018 06:18
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.

1 participant