Class: RocketAMF::Values::ErrorMessage

Inherits:
AcknowledgeMessage show all
Defined in:
lib/rocketamf/values/messages.rb

Overview

Maps to flex.messaging.messages.ErrorMessage in AMF3 mode

Constant Summary

Constant Summary

Constants inherited from AcknowledgeMessage

AcknowledgeMessage::EXTERNALIZABLE_FIELDS

Constants inherited from AsyncMessage

AsyncMessage::EXTERNALIZABLE_FIELDS

Constants inherited from AbstractMessage

AbstractMessage::EXTERNALIZABLE_FIELDS

Instance Attribute Summary (collapse)

Attributes inherited from AsyncMessage

#correlationId

Attributes inherited from AbstractMessage

#body, #clientId, #destination, #headers, #messageId, #timeToLive, #timestamp

Instance Method Summary (collapse)

Methods inherited from AcknowledgeMessage

#read_external

Methods inherited from AsyncMessage

#correlationIdBytes=, #read_external

Methods inherited from AbstractMessage

#clientIdBytes=, #messageIdBytes=, #read_external

Constructor Details

- (ErrorMessage) initialize(message = nil, exception = nil)



187
188
189
190
191
192
193
194
195
196
# File 'lib/rocketamf/values/messages.rb', line 187

def initialize message=nil, exception=nil
  super message

  unless exception.nil?
    @e = exception
    @faultCode = @e.class.name
    @faultDetail = @e.backtrace.join("\n")
    @faultString = @e.message
  end
end

Instance Attribute Details

- (Object) extendedData

Extended data that will facilitate custom error processing on the client



172
173
174
# File 'lib/rocketamf/values/messages.rb', line 172

def extendedData
  @extendedData
end

- (Object) faultCode

The fault code for the error, which defaults to the class name of the causing exception



176
177
178
# File 'lib/rocketamf/values/messages.rb', line 176

def faultCode
  @faultCode
end

- (Object) faultDetail

Detailed description of what caused the error



179
180
181
# File 'lib/rocketamf/values/messages.rb', line 179

def faultDetail
  @faultDetail
end

- (Object) faultString

A simple description of the error



182
183
184
# File 'lib/rocketamf/values/messages.rb', line 182

def faultString
  @faultString
end

- (Object) rootCause

Optional "root cause" of the error



185
186
187
# File 'lib/rocketamf/values/messages.rb', line 185

def rootCause
  @rootCause
end

Instance Method Details

- (Object) encode_amf(serializer)



198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/rocketamf/values/messages.rb', line 198

def encode_amf serializer
  if serializer.version == 0
    data = {
      :faultCode => @faultCode,
      :faultDetail => @faultDetail,
      :faultString => @faultString
    }
    serializer.write_object(data)
  else
    serializer.write_object(self)
  end
end