mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-13 01:24:40 +08:00
fix #1246: catch exceptions caused by GA report failure
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## 2.5.9 (2022-04-30)
|
||||
|
||||
- fix #1217: reload debugtalk.py if loaded
|
||||
- fix #1246: catch exceptions caused by GA report failure
|
||||
|
||||
## 2.5.8 (2022-03-23)
|
||||
|
||||
|
||||
@@ -55,7 +55,10 @@ class GAClient(object):
|
||||
'ev': value, # Optional. Event value, must be non-negative integer
|
||||
}
|
||||
data.update(self.common_params)
|
||||
self.http_client.post(self.report_url, data=data)
|
||||
try:
|
||||
self.http_client.post(self.report_url, data=data, timeout=5)
|
||||
except Exception: # ProxyError, SSLError, ConnectionError
|
||||
pass
|
||||
|
||||
def track_user_timing(self, category, variable, duration):
|
||||
data = {
|
||||
@@ -66,7 +69,10 @@ class GAClient(object):
|
||||
'utl': self.label, # Optional. user timing label, used as version.
|
||||
}
|
||||
data.update(self.common_params)
|
||||
self.http_client.post(self.report_url, data=data)
|
||||
try:
|
||||
self.http_client.post(self.report_url, data=data, timeout=5)
|
||||
except Exception: # ProxyError, SSLError, ConnectionError
|
||||
pass
|
||||
|
||||
|
||||
ga_client = GAClient("UA-114587036-1")
|
||||
|
||||
Reference in New Issue
Block a user