5 ivar_as_index :__ivars => 0, :message => 1, :context => 2
6 def message; @message ; end
8 def initialize(message = nil)
14 return nil unless @context
15 return @context if @context.kind_of? Array
16 awesome_backtrace.to_mri
20 return nil unless @context
21 unless @context.kind_of? Backtrace
22 @context = Backtrace.backtrace(@context)
32 @message || self.class.to_s
36 "#<#{self.class.name}: #{self.to_s}>"
39 alias_method :message, :to_s
40 alias_method :to_str, :to_s
42 def self.exception(message=nil)
46 def exception(message=nil)
48 self.class.new(message)
55 if @context.kind_of? Backtrace
56 return @context.top_context
64 [ctx.file.to_s, ctx.line]
69 # Primitive fails from opcode "send_primitive"
71 class PrimitiveFailure < Exception
74 class ScriptError < Exception
77 class StandardError < Exception
80 class SignalException < Exception
83 class NoMemoryError < Exception
86 class ZeroDivisionError < StandardError
89 class ArgumentError < StandardError
92 class IndexError < StandardError
95 class RangeError < StandardError
98 class FloatDomainError < RangeError
101 class LocalJumpError < StandardError
104 class NameError < StandardError
106 def initialize(*args)
112 class NoMethodError < NameError
115 def initialize(*arguments)
116 super(arguments.shift)
117 @name = arguments.shift
118 @args = arguments.shift
122 class RuntimeError < StandardError
125 class SecurityError < StandardError
128 class SystemStackError < StandardError
131 class ThreadError < StandardError
134 class TypeError < StandardError
137 class FloatDomainError < RangeError
140 class RegexpError < StandardError
143 class LoadError < ScriptError
146 class NotImplementedError < ScriptError
149 class Interrupt < SignalException
152 class IOError < StandardError
155 class EOFError < IOError
158 class LocalJumpError < StandardError
161 class NotImplementedError < ScriptError
164 class SyntaxError < ScriptError
165 attr_accessor :column
170 def import_position(c,l, code)
178 msg = "#{file}:#{@line}: #{msg}" if file && @line
183 class SystemCallError < StandardError
184 def errno; @errno ; end
186 def initialize(message, errno = nil)
187 if message.is_a?(Integer) && errno.nil?
189 message = "Unknown error"
196 class IllegalLongReturn
197 attr_reader :return_value
200 class ReturnException
201 attr_reader :return_value
209 class LongReturnException
211 attr_reader :is_return
213 def return_value=(val)
218 def break_value=(val)