| 1 |
class Exception |
| 2 |
## |
| 3 |
# call-seq: |
| 4 |
# exception.message -> string |
| 5 |
# |
| 6 |
# Returns the result of invoking <code>exception.to_s</code>. |
| 7 |
# Normally this returns the exception's message or name. |
| 8 |
# |
| 9 |
def message |
| 10 |
to_s |
| 11 |
end |
| 12 |
end |
| 13 |
|
| 14 |
# ISO 15.2.24 |
| 15 |
class ArgumentError < StandardError |
| 16 |
end |
| 17 |
|
| 18 |
# ISO 15.2.25 |
| 19 |
class LocalJumpError < StandardError |
| 20 |
end |
| 21 |
|
| 22 |
# ISO 15.2.26 |
| 23 |
class RangeError < StandardError |
| 24 |
end |
| 25 |
|
| 26 |
class FloatDomainError < RangeError |
| 27 |
end |
| 28 |
|
| 29 |
# ISO 15.2.26 |
| 30 |
class RegexpError < StandardError |
| 31 |
end |
| 32 |
|
| 33 |
# ISO 15.2.29 |
| 34 |
class TypeError < StandardError |
| 35 |
end |
| 36 |
|
| 37 |
# ISO 15.2.30 |
| 38 |
class ZeroDivisionError < StandardError |
| 39 |
end |
| 40 |
|
| 41 |
# ISO 15.2.31 |
| 42 |
class NameError < StandardError |
| 43 |
attr_accessor :name |
| 44 |
|
| 45 |
def initialize(message=nil, name=nil) |
| 46 |
@name = name |
| 47 |
super(message) |
| 48 |
end |
| 49 |
end |
| 50 |
|
| 51 |
# ISO 15.2.32 |
| 52 |
class NoMethodError < NameError |
| 53 |
attr_reader :args |
| 54 |
|
| 55 |
def initialize(message=nil, name=nil, args=nil) |
| 56 |
@args = args |
| 57 |
super message, name |
| 58 |
end |
| 59 |
end |
| 60 |
|
| 61 |
# ISO 15.2.33 |
| 62 |
class IndexError < StandardError |
| 63 |
end |
| 64 |
|
| 65 |
class KeyError < IndexError |
| 66 |
end |
| 67 |
|
| 68 |
class NotImplementedError < ScriptError |
| 69 |
end |
| 70 |
|
| 71 |
class FrozenError < RuntimeError |
| 72 |
end |
| 73 |
|
| 74 |
class StopIteration < IndexError |
| 75 |
attr_accessor :result |
| 76 |
end |