Beispiel #1
0
 def send_report(self):
     try:
         raport = BaseCrashReporter.get_report_string(self)
         self.logger.error("Crash Report", extra=raport)
     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'), raport)
     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)

        task = lambda: self.logger.error("Crash Report", extra=BaseCrashReporter.get_report_string(self))
        msg = _('Sending crash report...')
        WaitingDialog(self, msg, task, on_success, on_failure)