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

Make OverflowError's message a bit more detailed #7375

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/exception.cr
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ end
# that can be represented within the given operands types.
#
# ```
# Int32::MAX + 1 # raises OverflowError (Overflow)
# Int32::MIN - 1 # raises OverflowError (Overflow)
# Float64::MAX.to_f32 # raises OverflowError (Overflow)
# Int32::MAX + 1 # raises OverflowError (Arithmetic overflow)
# Int32::MIN - 1 # raises OverflowError (Arithmetic overflow)
# Float64::MAX.to_f32 # raises OverflowError (Arithmetic overflow)
# ```
class OverflowError < Exception
def initialize(message = "Overflow")
def initialize(message = "Arithmetic overflow")
super(message)
end
end
Expand Down