Closed talister closed 2 years ago
@zemogle am I right in thinking we need to catch a whole bunch more exceptions from various places and maybe these will go away (or become less frequent). Looking at the stack traces (not sure what all the gevent
stuff is; do we install/use that), it seems we need to do:
from requests import ConnectTimeout
from urllib3.exceptions import MaxRetryError, ConnectTimeoutError
in addition to the existing ConnectionError
and then change the catch to:
except (ConnectionError, ConnectTimout, MaxRetryError, ConnectTimeoutError) as e:
logger.error("Unable to connect to HORIZONS")
This just seems... yuck...
What a mess! I am surprised that the horizons library doesn't have a custom exception which would be much more useful.
We could use the explicit exceptions for all the system errors we know we might encounter, and then just catch the base classes. The errors classes you list should be subclasses of ConnectionError and TimeoutError.
except (ConnectionError, TimeoutError):
logger.error('Horizons Timeout')
Hopefully fixed by solution to Issue #586
View details in Rollbar: https://rollbar.com/LCO/NEOexchange/items/177/