Exception: Assembly::ServerError

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

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ServerError

Returns a new instance of ServerError.



179
180
181
# File 'lib/assembly/client.rb', line 179

def initialize(response)
  @response = response
end

Instance Method Details

#messageObject



187
188
189
190
191
192
193
194
# File 'lib/assembly/client.rb', line 187

def message
  body = @response.body
  if body && body.length > 0
    body[:message]
  else
    "No Error Message - Server response body was empty."
  end
end

#statusObject



183
184
185
# File 'lib/assembly/client.rb', line 183

def status
  @response.status
end

#to_sObject



196
197
198
# File 'lib/assembly/client.rb', line 196

def to_s
  "[#{status}] #{message}"
end