Skip to content

Commit

Permalink
Make OverflowError message a bit more detailed (#7375)
Browse files Browse the repository at this point in the history
  • Loading branch information
r00ster authored and sdogruyol committed Feb 6, 2019
1 parent d6dfc71 commit 7b7f285
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 7b7f285

Please sign in to comment.