mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
crash reporting: catch exceptions from requests.post
This commit is contained in:
parent
98a91c9306
commit
febaedcd36
1 changed files with 12 additions and 4 deletions
|
@ -107,14 +107,22 @@ class Exception_Window(QWidget):
|
||||||
def send_report(self):
|
def send_report(self):
|
||||||
if bitcoin.NetworkConstants.GENESIS[-4:] not in ["4943", "e26f"] and ".electrum.org" in report_server:
|
if bitcoin.NetworkConstants.GENESIS[-4:] not in ["4943", "e26f"] and ".electrum.org" in report_server:
|
||||||
# Gah! Some kind of altcoin wants to send us crash reports.
|
# Gah! Some kind of altcoin wants to send us crash reports.
|
||||||
self.main_window.show_critical("Please report this issue manually.")
|
self.main_window.show_critical(_("Please report this issue manually."))
|
||||||
return
|
return
|
||||||
report = self.get_traceback_info()
|
report = self.get_traceback_info()
|
||||||
report.update(self.get_additional_info())
|
report.update(self.get_additional_info())
|
||||||
report = json.dumps(report)
|
report = json.dumps(report)
|
||||||
response = requests.post(report_server, data=report)
|
try:
|
||||||
QMessageBox.about(self, "Crash report", response.text)
|
response = requests.post(report_server, data=report, timeout=20)
|
||||||
self.close()
|
except BaseException as e:
|
||||||
|
traceback.print_exc(file=sys.stderr)
|
||||||
|
self.main_window.show_critical(_('There was a problem with the automatic reporting:') + '\n' +
|
||||||
|
str(e) + '\n' +
|
||||||
|
_("Please report this issue manually."))
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
QMessageBox.about(self, "Crash report", response.text)
|
||||||
|
self.close()
|
||||||
|
|
||||||
def on_close(self):
|
def on_close(self):
|
||||||
Exception_Window._active_window = None
|
Exception_Window._active_window = None
|
||||||
|
|
Loading…
Add table
Reference in a new issue