add logs for proxy timeout exception
This commit is contained in:
@@ -108,6 +108,7 @@ class CommandorPage:
|
|||||||
self.page.goto(RDV_URL, timeout=90000)
|
self.page.goto(RDV_URL, timeout=90000)
|
||||||
return self.page.content()
|
return self.page.content()
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
|
params.oracle_log_sender.send_error(str(error))
|
||||||
self.logger.exception(error)
|
self.logger.exception(error)
|
||||||
self.browser.close()
|
self.browser.close()
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ class LogSender:
|
|||||||
msg = "{}, email: {}".format(result.message, result.email)
|
msg = "{}, email: {}".format(result.message, result.email)
|
||||||
self.send_log(msg, type=LOG_APPOINTMENT_ERROR)
|
self.send_log(msg, type=LOG_APPOINTMENT_ERROR)
|
||||||
|
|
||||||
|
def send_error(self, msg: str):
|
||||||
|
self.send_log(msg=msg, type=LOG_ERROR)
|
||||||
|
|
||||||
def send_log(self, msg: str, source=definitions.LOG_SOURCE, subject="appointment", type: str = "INFO"):
|
def send_log(self, msg: str, source=definitions.LOG_SOURCE, subject="appointment", type: str = "INFO"):
|
||||||
log_id = "ocid1.log.oc1.eu-frankfurt-1.amaaaaaas4ft22ya3ub6glkltqqbnmkxo3ui7xwq3dxtjd2scdhme4deyu2q"
|
log_id = "ocid1.log.oc1.eu-frankfurt-1.amaaaaaas4ft22ya3ub6glkltqqbnmkxo3ui7xwq3dxtjd2scdhme4deyu2q"
|
||||||
response = self._loggingingestion_client.put_logs(
|
response = self._loggingingestion_client.put_logs(
|
||||||
@@ -78,6 +81,7 @@ class LogSender:
|
|||||||
def send_wait_sms_log(self):
|
def send_wait_sms_log(self):
|
||||||
self.send_log("等待短信", subject=LOG_SUBJECT_EVENT, type=TYPE_SMS_RECEIVED)
|
self.send_log("等待短信", subject=LOG_SUBJECT_EVENT, type=TYPE_SMS_RECEIVED)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init_logger()
|
init_logger()
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|||||||
Reference in New Issue
Block a user