class DTK::Client::Execute::CommandProcessor::RestCall::Error

Public Class Methods

new(response_not_ok,rest_command) click to toggle source
Calls superclass method
# File lib/execute/command_processor/rest_call.rb, line 41
def initialize(response_not_ok,rest_command)
  error_print_form = error_print_form(response_not_ok)
  error_msg = "Bad Rest response from call (#{rest_command.input_hash.inspect}:\n #{error_print_form}"
  super(error_msg)
end

Private Instance Methods

error_print_form(response_not_ok) click to toggle source
# File lib/execute/command_processor/rest_call.rb, line 47
def error_print_form(response_not_ok)
  ret_obj = 
    if errors = response_not_ok['errors']
      errors.size == 1 ? errors.first : errors
     else
      response_not_ok
    end
  ret_obj.kind_of?(String) ? ret_obj : ret_obj.inspect
end