def_e2message

def_e2message(k, c, m) Class Public methods Exception2MessageMapper#def_e2message(k, e, m) k: class to define exception under. e: exception m: message_form define exception c with message m.

Raise

Raise(klass = E2MM, err = nil, *rest) Class Public methods Fail(klass, err, *rest) klass: class to define exception under. err: exception rest: message arguments Fail

Fail

Fail(klass = E2MM, err = nil, *rest) Class Public methods Alias for: Raise

to_s

exception.to_s â string Instance Public methods Returns exception's message (or the name of the exception if no message is set).

to_json

to_json(*args) Instance Public methods Stores class name (Exception) with message m and backtrace array b as JSON string

set_backtrace

exc.set_backtrace(backtrace) â array Instance Public methods Sets the backtrace information associated with exc. The backtrace must be an array of String objects or a single String in the format described in #backtrace.

message

exception.message â string Instance Public methods Returns the result of invoking exception.to_s. Normally this returns the exception's message or name. By supplying a to_str method, exceptions are agreeing to be used where Strings are expected.

inspect

exception.inspect â string Instance Public methods Return this exception's class name and message

exception 2

exc.exception(string) â an_exception or exc Instance Public methods With no argument, or if the argument is the same as the receiver, return the receiver. Otherwise, create a new exception object of the same class as the receiver, but with a message equal to string.to_str.

backtrace

exception.backtrace â array Instance Public methods Returns any backtrace associated with the exception. The backtrace is an array of strings, each containing either âfilename:lineNo: in `method''' or âfilename:lineNo.'' def a raise "boom" end def b a() end begin b() rescue => detail print detail.backtrace.join("\n") end produces: prog.rb:2:in `a' prog.rb:6:in `b' prog.rb:10