Exception: Tina4::APIStreamError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tina4/api.rb

Overview

Raised when a streaming request (stream_bytes / stream_lines / stream_sse) opens successfully but the HTTP status is not 2xx. The buffered execute path folds an error status into an APIResponse; a streaming caller has no response object to inspect, so the error is raised at the moment the status is known -- before any bytes are yielded (the pre-stream error contract of ADR-0060). Carries the status code for the caller to switch on.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status = nil) ⇒ APIStreamError

Returns a new instance of APIStreamError.



800
801
802
803
# File 'lib/tina4/api.rb', line 800

def initialize(message, status = nil)
  super(message)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



798
799
800
# File 'lib/tina4/api.rb', line 798

def status
  @status
end