handle gateway error

This commit is contained in:
2024-08-04 22:32:16 +02:00
parent 692afc3a39
commit a1df129225
+3
View File
@@ -122,6 +122,9 @@ class Sender:
# session = HTMLSession() # session = HTMLSession()
self.logger.info("blocked by hermes, mail:{}".format(contact.mail)) self.logger.info("blocked by hermes, mail:{}".format(contact.mail))
return RequestResult.BLOCKED return RequestResult.BLOCKED
elif response.status_code == 502:
self.logger.info("proxy error, mail:{}".format(contact.mail))
return RequestResult.PROXY_ERROR
return RequestResult.BLOCKED return RequestResult.BLOCKED
except Exception as Error: except Exception as Error:
print(Error) print(Error)