Skip to content

Commit eeb08fb

Browse files
committed
Don't assume exception has a response
The wrapped OpenSSL exceptions don't have a response: #<Faraday::SSLError wrapped=#<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed>> Follow up to #585.
1 parent 1baa7f2 commit eeb08fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/raven/transports/http.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def send_event(auth_header, data, options = {})
2929
end
3030
rescue Faraday::ClientError => ex
3131
error_info = ex.message
32-
error_info += " Error in headers is: #{ex.response[:headers]['x-sentry-error']}" if ex.response[:headers]['x-sentry-error']
32+
if ex.response && ex.response[:headers]['x-sentry-error']
33+
error_info += " Error in headers is: #{ex.response[:headers]['x-sentry-error']}"
34+
end
3335
raise Raven::Error, error_info
3436
end
3537

0 commit comments

Comments
 (0)