protect calls to log_internal_error against socket.error and OSError
This commit is contained in:
parent
d54f36b114
commit
10ee5d1eb6
|
@ -90,7 +90,15 @@ def cron(publisher):
|
|||
None,
|
||||
exc_type, exc_value,
|
||||
tb)
|
||||
publisher.logger.log_internal_error(error_summary, plain_error_msg)
|
||||
try:
|
||||
publisher.logger.log_internal_error(error_summary, plain_error_msg)
|
||||
except socket.error:
|
||||
# will happen if there is no mail server available and exceptions
|
||||
# were configured to be mailed.
|
||||
pass
|
||||
except OSError:
|
||||
# this could happen on file descriptor exhaustion
|
||||
pass
|
||||
time.sleep(10)
|
||||
|
||||
|
||||
|
|
|
@ -139,7 +139,15 @@ class HTTPResponse(quixote.http_response.HTTPResponse):
|
|||
exc_type, exc_value,
|
||||
tb)
|
||||
|
||||
get_publisher().logger.log_internal_error(error_summary, plain_error_msg)
|
||||
try:
|
||||
get_publisher().logger.log_internal_error(error_summary, plain_error_msg)
|
||||
except socket.error:
|
||||
# will happen if there is no mail server available and exceptions
|
||||
# were configured to be mailed.
|
||||
pass
|
||||
except OSError:
|
||||
# this could happen on file descriptor exhaustion
|
||||
pass
|
||||
|
||||
job.exception = traceback.format_exc()
|
||||
job.status = N_('failed')
|
||||
|
|
Loading…
Reference in New Issue