3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/hermes_api/connection.rb', line 3
def request(method, path, *arguments)
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
payload[:method] = method
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
arguments.last["Content-Type"] = "text/xml"
payload[:result] = http.send(method, path, *arguments)
payload[:result]
end
raise HermesAPI::CreationError, result if result.body.include?("errorMessages")
handle_response(result)
rescue Timeout::Error => e
raise TimeoutError, e.message
rescue OpenSSL::SSL::SSLError => e
raise SSLError, e.message
end
|