This repository was archived by the owner on Oct 23, 2023. It is now read-only.
How to handle exceptions in raven itself? #1173
Open
Description
I ran into the following situation - the software crashed, raven
rightfully stepped in and prepared a report to be sent to Sentry
. However, the system where the client was running was experiencing Internet connectivity issues - thus raven
itself crashed.
ERROR sentry.errors Sentry responded with an error: <urlopen error [Errno -2] Name or service not known> (url: https://example.com/api/3/store/)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/raven/transport/threaded.py", line 165, in send_sync
super(ThreadedHTTPTransport, self).send(url, data, headers)
File "/usr/local/lib/python2.7/dist-packages/raven/transport/http.py", line 43, in send
ca_certs=self.ca_certs,
File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>
ERROR sentry.errors.uncaught ]
Is there a way to define a handler for these situations? Or otherwise configure raven
to try later or just ignore it? I have not found any discussion of these aspects in the documentation.
This is how I am using the software:
from sentry import Client
sentry_client = Client('https://xxxxxxxxxxxx')
# lots of other code