Exception: ZeroRuby::OutOfOrderMutationError

Inherits:
Error
  • Object
show all
Defined in:
lib/zero_ruby/errors.rb

Overview

Raised when mutations arrive out of order

Instance Attribute Summary collapse

Attributes inherited from Error

#details

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, received_id:, expected_id:) ⇒ OutOfOrderMutationError

Returns a new instance of OutOfOrderMutationError.



79
80
81
82
83
84
# File 'lib/zero_ruby/errors.rb', line 79

def initialize(client_id:, received_id:, expected_id:)
  @client_id = client_id
  @received_id = received_id
  @expected_id = expected_id
  super("Client #{client_id} sent mutation ID #{received_id} but expected #{expected_id}")
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



77
78
79
# File 'lib/zero_ruby/errors.rb', line 77

def client_id
  @client_id
end

#expected_idObject (readonly)

Returns the value of attribute expected_id.



77
78
79
# File 'lib/zero_ruby/errors.rb', line 77

def expected_id
  @expected_id
end

#received_idObject (readonly)

Returns the value of attribute received_id.



77
78
79
# File 'lib/zero_ruby/errors.rb', line 77

def received_id
  @received_id
end

Instance Method Details

#error_typeObject



86
87
88
# File 'lib/zero_ruby/errors.rb', line 86

def error_type
  "ooo"
end