5 ivar_as_index :__ivars => 0, :message => 1, :context => 2
6 def message; @message ; end
8 def initialize(message = nil)
15 return @backtrace if @backtrace
16 return nil unless @context
17 awesome_backtrace.to_mri
21 return nil unless @context
22 @backtrace = Backtrace.backtrace(@context)
30 @message || self.class.to_s
34 "#<#{self.class.name}: #{self.to_s}>"
37 alias_method :message, :to_s
38 alias_method :to_str, :to_s
40 def self.exception(message=nil)
44 def exception(message=nil)
46 self.class.new(message)
62 [ctx.file.to_s, ctx.line]
67 # Primitive fails from opcode "send_primitive"
69 class PrimitiveFailure < Exception
72 class ScriptError < Exception
75 class StandardError < Exception
78 class SignalException < Exception
81 class NoMemoryError < Exception
84 class ZeroDivisionError < StandardError
87 class ArgumentError < StandardError
90 class IndexError < StandardError
93 class RangeError < StandardError
96 class FloatDomainError < RangeError
99 class LocalJumpError < StandardError
102 class NameError < StandardError
104 def initialize(*args)
110 class NoMethodError < NameError
113 def initialize(*arguments)
114 super(arguments.shift)
115 @name = arguments.shift
116 @args = arguments.shift
120 class RuntimeError < StandardError
123 class SecurityError < StandardError
126 class SystemStackError < StandardError
129 class ThreadError < StandardError
132 class TypeError < StandardError
135 class FloatDomainError < RangeError
138 class RegexpError < StandardError
141 class LoadError < ScriptError
144 class NotImplementedError < ScriptError
147 class Interrupt < SignalException
150 class IOError < StandardError
153 class EOFError < IOError
156 class LocalJumpError < StandardError
159 class NotImplementedError < ScriptError
162 class SyntaxError < ScriptError
163 attr_accessor :column
168 def import_position(c,l, code)
176 msg = "#{file}:#{@line}: #{msg}" if file && @line
181 class SystemCallError < StandardError
182 def errno; @errno ; end
184 def initialize(message, errno = nil)
185 if message.is_a?(Integer) && errno.nil?
187 message = "Unknown error"
195 # Raised when you try to return from a block when not allowed. Never seen by
198 class IllegalLongReturn < LocalJumpError
199 attr_reader :return_value
203 # Abstract class for implementing flow control in Rubinius. Never seen by
206 class FlowControlException < Exception
210 # Flow control exception used to implement return inside an ensure. Never
213 class ReturnException < FlowControlException
214 attr_reader :return_value
223 # Raised when returning from a block to handle proper flow control. Never
226 class LongReturnException < FlowControlException
228 attr_reader :is_return
230 def return_value=(val)
235 def break_value=(val)