Exception: Emissary::Error
- Defined in:
- lib/emissary/errors.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ConnectionError, InvalidMessageFormat, NotImplementedError
Instance Attribute Summary collapse
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Class Method Summary collapse
-
.new(*args) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#initialize(origin = Exception, message = '') ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #origin_backtrace ⇒ Object
- #origin_message ⇒ Object
Constructor Details
#initialize(origin = Exception, message = '') ⇒ Error
Returns a new instance of Error.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/emissary/errors.rb', line 45 def initialize(origin = Exception, = '') case origin when Exception @origin = origin when Class @origin = origin.new else @origin = Exception.new end super end |
Instance Attribute Details
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
23 24 25 |
# File 'lib/emissary/errors.rb', line 23 def origin @origin end |
Class Method Details
.new(*args) ⇒ Object
:nodoc:
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/emissary/errors.rb', line 25 def self.new(*args) #:nodoc: allocate.instance_eval(<<-EOS, __FILE__, __LINE__) alias :original_instance_of? :instance_of? alias :original_kind_of? :kind_of? def instance_of? klass self.original_instance_of? klass or origin.instance_of? klass end def kind_of? klass self.original_kind_of? klass or origin.kind_of? klass end # Call a superclass's #initialize if it has one initialize(*args) self EOS end |
Instance Method Details
#message ⇒ Object
67 68 69 70 |
# File 'lib/emissary/errors.rb', line 67 def "#{super}\n\t#{self.backtrace.join("\n\t")}\n" + "Origin: #{origin.class}: #{}\n\t#{origin_backtrace.join("\n\t")}" end |
#origin_backtrace ⇒ Object
59 60 61 |
# File 'lib/emissary/errors.rb', line 59 def origin_backtrace origin.backtrace end |
#origin_message ⇒ Object
63 64 65 |
# File 'lib/emissary/errors.rb', line 63 def origin. end |