Do not crash on network error while sending survey
This commit is contained in:
parent
f12e35fef9
commit
ef209ea93f
@ -41,9 +41,11 @@ def send_survey(data):
|
|||||||
headers = {"Content-type":
|
headers = {"Content-type":
|
||||||
"application/x-www-form-urlencoded", "Accept": "text/plain"}
|
"application/x-www-form-urlencoded", "Accept": "text/plain"}
|
||||||
connection = http.client.HTTPConnection('feedback-ltworf.appspot.com')
|
connection = http.client.HTTPConnection('feedback-ltworf.appspot.com')
|
||||||
|
try:
|
||||||
connection.request("POST", "/feedback/relational", params, headers)
|
connection.request("POST", "/feedback/relational", params, headers)
|
||||||
|
return connection.getresponse().status
|
||||||
return connection.getresponse()
|
except:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def check_latest_version():
|
def check_latest_version():
|
||||||
|
@ -82,7 +82,7 @@ class surveyForm (QtWidgets.QWidget):
|
|||||||
|
|
||||||
response = maintenance.send_survey(post)
|
response = maintenance.send_survey(post)
|
||||||
|
|
||||||
if response.status != 200:
|
if response != 200:
|
||||||
QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
|
QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
|
||||||
"Form", "Error"), QtWidgets.QApplication.translate("Form", "Unable to send the data!"))
|
"Form", "Error"), QtWidgets.QApplication.translate("Form", "Unable to send the data!"))
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user