def send_report(self): try: response = BaseCrashReporter.send_report(self, "/crash.json").json() except requests.exceptions.RequestException: self.show_popup(_('Unable to send report'), _("Please check your network connection.")) else: self.show_popup(_('Report sent'), response["text"]) if response["location"]: self.open_url(response["location"]) self.dismiss()
def send_report(self): try: response = BaseCrashReporter.send_report(self) 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 QMessageBox.about(self, _("Crash report"), response.text) self.close()
def send_report(self): try: loop = self.main_window.network.asyncio_loop proxy = self.main_window.network.proxy response = json.loads(BaseCrashReporter.send_report(self, loop, proxy, "/crash.json")) except (ValueError, ClientError): self.show_popup(_('Unable to send report'), _("Please check your network connection.")) else: self.show_popup(_('Report sent'), response["text"]) if response["location"]: self.open_url(response["location"]) self.dismiss()
def send_report(self): try: loop = self.main_window.network.asyncio_loop proxy = self.main_window.network.proxy # FIXME network request in GUI thread... response = json.loads(BaseCrashReporter.send_report(self, loop, proxy, "/crash.json", timeout=10)) except (ValueError, ClientError) as e: self.logger.warning(f"Error sending crash report. exc={e!r}") self.show_popup(_('Unable to send report'), _("Please check your network connection.")) else: self.show_popup(_('Report sent'), response["text"]) location = response["location"] if location: self.logger.info(f"Crash report sent. location={location!r}") self.open_url(location) self.dismiss()
def send_report(self): try: loop = self.main_window.network.asyncio_loop proxy = self.main_window.network.proxy # FIXME network request in GUI thread... response = json.loads( BaseCrashReporter.send_report(self, loop, proxy, "/crash.json", timeout=10)) except (ValueError, ClientError): #self.logger.debug("", exc_info=True) self.show_popup(_('Unable to send report'), _("Please check your network connection.")) else: self.show_popup(_('Report sent'), response["text"]) if response["location"]: self.open_url(response["location"]) self.dismiss()
def send_report(self): def on_success(response): # note: 'response' coming from (remote) crash reporter server. # It contains a URL to the GitHub issue, so we allow rich text. self.show_message(parent=self, title=_("Crash report"), msg=response, rich_text=True) self.close() def on_failure(exc_info): e = exc_info[1] self.logger.error('There was a problem with the automatic reporting', exc_info=exc_info) self.show_critical(parent=self, msg=(_('There was a problem with the automatic reporting:') + '<br/>' + repr(e)[:120] + '<br/>' + _("Please report this issue manually") + f' <a href="{constants.GIT_REPO_ISSUES_URL}">on GitHub</a>.'), rich_text=True) proxy = self.main_window.network.proxy task = lambda: BaseCrashReporter.send_report(self, self.main_window.network.asyncio_loop, proxy) msg = _('Sending crash report...') WaitingDialog(self, msg, task, on_success, on_failure)