Exception: Qwirk::RemoteException
- Inherits:
-
Exception
- Object
- Exception
- Qwirk::RemoteException
- Defined in:
- lib/qwirk/remote_exception.rb
Instance Attribute Summary collapse
-
#originating_exception_message ⇒ Object
Returns the value of attribute originating_exception_message.
-
#originating_exception_name ⇒ Object
Returns the value of attribute originating_exception_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(originating_exception = nil, message = nil) ⇒ RemoteException
constructor
A new instance of RemoteException.
- #marshal ⇒ Object
- #message ⇒ Object
- #message=(msg) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(originating_exception = nil, message = nil) ⇒ RemoteException
Returns a new instance of RemoteException.
6 7 8 9 10 11 12 13 14 |
# File 'lib/qwirk/remote_exception.rb', line 6 def initialize(originating_exception=nil, =nil) super() if originating_exception @originating_exception_name = originating_exception.class.name @originating_exception_message = originating_exception. set_backtrace(originating_exception.backtrace) end @message = end |
Instance Attribute Details
#originating_exception_message ⇒ Object
Returns the value of attribute originating_exception_message.
4 5 6 |
# File 'lib/qwirk/remote_exception.rb', line 4 def @originating_exception_message end |
#originating_exception_name ⇒ Object
Returns the value of attribute originating_exception_name.
3 4 5 |
# File 'lib/qwirk/remote_exception.rb', line 3 def originating_exception_name @originating_exception_name end |
Class Method Details
.from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/qwirk/remote_exception.rb', line 37 def self.from_hash(hash) exc = new exc. = hash['message'] exc.originating_exception_name = hash['originating_exception_name'] exc. = hash['originating_exception_message'] exc.set_backtrace(hash['backtrace']) return exc end |
.unmarshal(yaml_str) ⇒ Object
46 47 48 |
# File 'lib/qwirk/remote_exception.rb', line 46 def self.unmarshal(yaml_str) from_hash(YAML.load(yaml_str)) end |
Instance Method Details
#marshal ⇒ Object
33 34 35 |
# File 'lib/qwirk/remote_exception.rb', line 33 def marshal to_hash.to_yaml end |
#message ⇒ Object
16 17 18 |
# File 'lib/qwirk/remote_exception.rb', line 16 def @message || @originating_exception_message end |
#message=(msg) ⇒ Object
20 21 22 |
# File 'lib/qwirk/remote_exception.rb', line 20 def (msg) @message = msg end |
#to_hash ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/qwirk/remote_exception.rb', line 24 def to_hash { 'message' => @message, 'originating_exception_name' => @originating_exception_name, 'originating_exception_message' => @originating_exception_message, 'backtrace' => backtrace } end |