Exception: Plushie::ProtocolVersionMismatchError

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

Overview

Raised when the renderer's advertised protocol version differs from the version the SDK was built against. Carries both versions so callers can decide retry vs abort without string parsing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expected:, got:) ⇒ ProtocolVersionMismatchError

Returns a new instance of ProtocolVersionMismatchError.



138
139
140
141
142
# File 'lib/plushie.rb', line 138

def initialize(expected:, got:)
  super("protocol version mismatch: expected #{expected}, got #{got.inspect}")
  @expected = expected
  @got = got
end

Instance Attribute Details

#expectedInteger (readonly)

Returns protocol version this SDK was built for.

Returns:

  • (Integer)

    protocol version this SDK was built for.



134
135
136
# File 'lib/plushie.rb', line 134

def expected
  @expected
end

#gotInteger? (readonly)

Returns protocol version the renderer advertised.

Returns:

  • (Integer, nil)

    protocol version the renderer advertised.



136
137
138
# File 'lib/plushie.rb', line 136

def got
  @got
end