Exception: HTTPX::Connection::HTTP2::GoawayError

Inherits:
Error
  • Object
show all
Defined in:
lib/httpx/connection/http2.rb,
sig/connection/http2.rbs

Constant Summary collapse

UNRECOVERABLE_ERRORS =

Returns:

  • (Array[Symbol])
%i[settings_timeout inadequate_security].freeze

Instance Method Summary collapse

Constructor Details

#initialize(code, last_stream_id) ⇒ GoawayError

Returns a new instance of GoawayError.

Parameters:

  • code (Symbol)
  • last_stream_id (Integer)


28
29
30
31
32
# File 'lib/httpx/connection/http2.rb', line 28

def initialize(code, last_stream_id)
  @code = code
  @last_stream_id = last_stream_id
  super(0, code)
end

Instance Method Details

#last_stream_id ⇒ Numeric

Returns:

  • (Numeric)


34
35
36
37
38
# File 'lib/httpx/connection/http2.rb', line 34

def last_stream_id
  return Float::INFINITY if unrecoverable?

  @last_stream_id
end

#unrecoverable? ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/httpx/connection/http2.rb', line 40

def unrecoverable?
  @last_stream_id.zero? || UNRECOVERABLE_ERRORS.include?(@code)
end