Exception: Surfliner::MetadataConsumer::SuperskunkClient::UnexpectedResponse

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/surfliner/metadata_consumer/superskunk_client.rb

Overview

Exception raised in the event of an unexpected HTTP status code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, status) ⇒ UnexpectedResponse

Returns a new instance of UnexpectedResponse.

Parameters:

  • uri (URI)

    the request URI

  • status (Integer)

    the HTTP status code



61
62
63
64
65
66
# File 'lib/surfliner/metadata_consumer/superskunk_client.rb', line 61

def initialize(uri, status)
  super("Failed to fetch #{uri}; status #{status}")

  @uri = uri
  @status = status
end

Instance Attribute Details

#statusInteger (readonly)

Returns the HTTP status code.

Returns:

  • (Integer)

    the HTTP status code



57
58
59
# File 'lib/surfliner/metadata_consumer/superskunk_client.rb', line 57

def status
  @status
end

#uriURI (readonly)

Returns the request URI.

Returns:

  • (URI)

    the request URI



54
55
56
# File 'lib/surfliner/metadata_consumer/superskunk_client.rb', line 54

def uri
  @uri
end