Exception: Minisky::UnexpectedRedirect

Inherits:
BadResponse show all
Defined in:
lib/minisky/errors.rb

Overview

Raised when the API returns a redirect status code (3xx). Minisky doesn't currently follow any redirects.

Instance Attribute Summary collapse

Attributes inherited from BadResponse

#data, #status

Instance Method Summary collapse

Methods inherited from BadResponse

#error_message, #error_type

Constructor Details

#initialize(status, status_message, location) ⇒ UnexpectedRedirect

Returns a new instance of UnexpectedRedirect.

Parameters:

  • status (Integer)

    HTTP status code

  • status_message (String)

    HTTP status message

  • location (String)

    value of the "Location" header



88
89
90
91
# File 'lib/minisky/errors.rb', line 88

def initialize(status, status_message, location)
  super(status, status_message, { 'message' => "Unexpected redirect: #{location}" })
  @location = location
end

Instance Attribute Details

#locationString (readonly)

Returns value of the "Location" header.

Returns:

  • (String)

    value of the "Location" header



82
83
84
# File 'lib/minisky/errors.rb', line 82

def location
  @location
end