Exception: ModernTimes::RemoteException
- Inherits:
-
Exception
- Object
- Exception
- ModernTimes::RemoteException
- Defined in:
- lib/modern_times/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.
- #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/modern_times/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/modern_times/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/modern_times/remote_exception.rb', line 3 def originating_exception_name @originating_exception_name end |
Class Method Details
.from_hash(hash) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/modern_times/remote_exception.rb', line 33 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 |
Instance Method Details
#message ⇒ Object
16 17 18 |
# File 'lib/modern_times/remote_exception.rb', line 16 def @message || @originating_exception_message end |
#message=(msg) ⇒ Object
20 21 22 |
# File 'lib/modern_times/remote_exception.rb', line 20 def (msg) @message = msg end |
#to_hash ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/modern_times/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 |