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

Change RangeError to a more specific ActiveModel::RangeError #24835

merged 1 commit into from May 3, 2016


None yet
5 participants
Copy link

christianblais commented May 3, 2016


When provided with large numbers, ActiveModel fails with a generic
RangeError. While it is technically true, the fact that this is a generic,
non specific error make it really hard to implement application wide
rescue_from to handle bad requests.

With this PR, ActiveModel would now throw a specific ActiveModel::RangeError,
which inherits from RangeError to maintain compatibility.

Change RangeError to a more specific ActiveModel::RangeError
The should make it easier for apps to rescue ActiveModel specific
errors without the need to wrap all method calls with a generic
rescue RangeError.

This comment has been minimized.

Copy link

rails-bot commented May 3, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rafaelfranca rafaelfranca merged commit 83a8682 into rails:master May 3, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed

vipulnsward added a commit to vipulnsward/rails that referenced this pull request May 3, 2016

Followup of rails#24835
Fix failing tests

@christianblais christianblais deleted the christianblais:activemodel/rangeerror branch May 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment