def cascade_serializers(action, packet, serializers, id = nil)
      errors = []
      serializers.map do |serializer|
        obj = nil
        begin
          obj = serializer == SecureSerializer ? serializer.send(action, packet, id) : serializer.send(action, packet)
        rescue RightSupport::Net::NoResult, SocketError => e
          raise Exceptions::ConnectivityFailure.new("Failed to #{action} with #{serializer.name} due to external " +
                                                    "service access failures (#{e.class.name}: #{e.message})", e)
        rescue SecureSerializer::MissingCertificate, SecureSerializer::MissingPrivateKey, SecureSerializer::InvalidSignature => e
          errors << Log.format("Failed to #{action} with #{serializer.name}", e)
        rescue StandardError => e
          errors << Log.format("Failed to #{action} with #{serializer.name}", e, :trace)
        end
        return obj if obj
      end
      raise SerializationError.new(action, packet, serializers, errors.join("\n"))
    end
def cascade_serializers(action, packet, serializers, id = nil)
      errors = []
      serializers.map do |serializer|
        obj = nil
        begin
          obj = serializer == SecureSerializer ? serializer.send(action, packet, id) : serializer.send(action, packet)
        rescue RightSupport::Net::NoResult, SocketError => e
          raise Exceptions::ConnectivityFailure.new("Failed to #{action} with #{serializer.name} due to external " +
                                                    "service access failures (#{e.class.name}: #{e.message})", e)
        rescue SecureSerializer::MissingCertificate, SecureSerializer::MissingPrivateKey, SecureSerializer::InvalidSignature => e
          errors << Log.format("Failed to #{action} with #{serializer.name}", e)
        rescue StandardError => e
          errors << Log.format("Failed to #{action} with #{serializer.name}", e, :trace)
        end
        return obj if obj
      end
      raise SerializationError.new(action, packet, serializers, errors.join("\n"))
    end
Apply serializers in order until one succeeds

 === Parameters
 action(Symbol):: Serialization action: :dump or :load
 packet(Object|String):: Object or serialized data on which action is to be performed
 serializers(Array):: Serializers to apply in order
 id(String):: Optional identifier of source of data for use in determining who is the receiver

 === Return
 (String|Object):: Result of serialization action

 === Raises
 SerializationError:: If none of the serializers can perform the requested action
 RightScale::Exceptions::ConnectivityFailure:: If cannot access external services