class Orchestrate::API::BaseError

Base class for Errors from Orchestrate.

Attributes

response[R]

@return [Faraday::Response] The response that caused the error.

Public Class Methods

code() click to toggle source

class-level attr-reader for the error’s code. @return [String] API’s error code.

# File lib/orchestrate/api/errors.rb, line 11
def self.code; @code; end
new(response) click to toggle source

@param response [Faraday::Response] The response that caused the error.

Calls superclass method
# File lib/orchestrate/api/errors.rb, line 17
def initialize(response)
  @response = response
  if response.headers['Content-Type'] == 'application/json' && response.body
    super(response.body['message'])
  else
    super(response.body)
  end
end
status() click to toggle source

class-level attr-reader for the error’s response code. @return [Integer] Status code for error.

# File lib/orchestrate/api/errors.rb, line 7
def self.status; @status; end