Class: RocketAMF::Values::ErrorMessage
- Inherits:
-
AcknowledgeMessage
- Object
- AbstractMessage
- AsyncMessage
- AcknowledgeMessage
- RocketAMF::Values::ErrorMessage
- Defined in:
- lib/rocketamf/values/messages.rb
Overview
Maps to flex.messaging.messages.ErrorMessage
in AMF3 mode
Instance Attribute Summary collapse
-
#extendedData ⇒ Object
Extended data that will facilitate custom error processing on the client.
-
#faultCode ⇒ Object
The fault code for the error, which defaults to the class name of the causing exception.
-
#faultDetail ⇒ Object
Detailed description of what caused the error.
-
#faultString ⇒ Object
A simple description of the error.
-
#rootCause ⇒ Object
Optional “root cause” of the error.
Attributes inherited from AsyncMessage
Attributes inherited from AbstractMessage
#body, #clientId, #destination, #headers, #messageId, #timeToLive, #timestamp
Instance Method Summary collapse
-
#initialize(message = nil, exception = nil) ⇒ ErrorMessage
constructor
A new instance of ErrorMessage.
- #to_amf(serializer) ⇒ Object
Constructor Details
#initialize(message = nil, exception = nil) ⇒ ErrorMessage
Returns a new instance of ErrorMessage.
108 109 110 111 112 113 114 115 116 117 |
# File 'lib/rocketamf/values/messages.rb', line 108 def initialize =nil, exception=nil super unless exception.nil? @e = exception @faultCode = @e.class.name @faultDetail = @e.backtrace.join("\n") @faultString = @e. end end |
Instance Attribute Details
#extendedData ⇒ Object
Extended data that will facilitate custom error processing on the client
93 94 95 |
# File 'lib/rocketamf/values/messages.rb', line 93 def extendedData @extendedData end |
#faultCode ⇒ Object
The fault code for the error, which defaults to the class name of the causing exception
97 98 99 |
# File 'lib/rocketamf/values/messages.rb', line 97 def faultCode @faultCode end |
#faultDetail ⇒ Object
Detailed description of what caused the error
100 101 102 |
# File 'lib/rocketamf/values/messages.rb', line 100 def faultDetail @faultDetail end |
#faultString ⇒ Object
A simple description of the error
103 104 105 |
# File 'lib/rocketamf/values/messages.rb', line 103 def faultString @faultString end |
#rootCause ⇒ Object
Optional “root cause” of the error
106 107 108 |
# File 'lib/rocketamf/values/messages.rb', line 106 def rootCause @rootCause end |
Instance Method Details
#to_amf(serializer) ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/rocketamf/values/messages.rb', line 119 def to_amf serializer stream = "" if serializer.version == 0 data = { :faultCode => @faultCode, :faultDetail => @faultDetail, :faultString => @faultString } serializer.write_hash(data, stream) else serializer.write_object(self, stream) end stream end |