require 'httparty'
require 'json'

module SlackbotFrd
  module SlackMethods
    module ValidateSlack
      def self.response(response)
        if response['ok']
          response
        else
          msg = if response['error']
                  response['error']
                else
                  'Slack returned an error'
                end
          raise AuthenticationFailedError.new("#{msg} - response: #{response}")
        end
      end
    end
  end
end

require 'httparty'
require 'json'

module SlackbotFrd
  module SlackMethods
    module ValidateSlack
      def self.response(response)
        if response['ok']
          response
        else
          msg = if response['error']
                  response['error']
                else
                  'Slack returned an error'
                end
          raise StandardError.new("#{msg} - response: #{response}")
        end
      end
    end
  end
end

Switch validation error to StandardError
Switch validation error to StandardError
