Skip to content

Commit 40f05be

Browse files
authored
Merge pull request #629 from drewish/do-not-assume-response
Don't assume exception has a response
2 parents 1baa7f2 + eeb08fb commit 40f05be

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)