Exception: Spaceship::Client::UnexpectedResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/spaceship/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_info = nil) ⇒ UnexpectedResponse

Returns a new instance of UnexpectedResponse.



53
54
55
56
# File 'lib/spaceship/client.rb', line 53

def initialize(error_info = nil)
  super(error_info)
  @error_info = error_info
end

Instance Attribute Details

#error_infoObject (readonly)

Returns the value of attribute error_info.



51
52
53
# File 'lib/spaceship/client.rb', line 51

def error_info
  @error_info
end

Instance Method Details

#preferred_error_infoObject



58
59
60
61
62
63
64
65
66
# File 'lib/spaceship/client.rb', line 58

def preferred_error_info
  return nil unless @error_info.kind_of?(Hash) && @error_info['resultString']

  [
    "Apple provided the following error info:",
    @error_info['resultString'],
    @error_info['userString']
  ].compact.uniq # sometimes 'resultString' and 'userString' are the same value
end