def _handle_upgrade_error(self): self._backup_failed_upgrade_db() title = _("%(appname)s database upgrade failed", {"appname": app.config.get(prefs.SHORT_APP_NAME)}) description = _( "We're sorry, %(appname)s was unable to upgrade your database " "due to errors.\n\n" "Check to see if your disk is full. If it is full, then quit " "%(appname)s, free up some space, and start %(appname)s " "again.\n\n" "If your disk is not full, help us understand the problem by " "reporting a bug to our crash database.\n\n" "Finally, you can start fresh and your damaged database will be " "removed, but you will have to re-add your podcasts and media " "files.", {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) d = dialogs.ThreeChoiceDialog(title, description, dialogs.BUTTON_QUIT, dialogs.BUTTON_SUBMIT_REPORT, dialogs.BUTTON_START_FRESH) choice = d.run_blocking() if choice == dialogs.BUTTON_START_FRESH: self._handle_load_error("Error upgrading database") self.startup_version = self.current_version = self._get_version() elif choice == dialogs.BUTTON_SUBMIT_REPORT: report = crashreport.format_crash_report("Upgrading Database", exc_info=sys.exc_info(), details=None) raise UpgradeErrorSendCrashReport(report) else: raise UpgradeError()
def failed(self, when, with_exception=False, details=None): """Used to emit the error signal. Formats a nice crash report.""" logging.info("failed() called; generating crash report.") if with_exception: exc_info = sys.exc_info() else: exc_info = None self.emit("error", crashreport.format_crash_report(when, exc_info, details))
def failed(self, when, with_exception=False, details=None): """Used to emit the error signal. Formats a nice crash report.""" logging.info ("failed() called; generating crash report.") if with_exception: exc_info = sys.exc_info() else: exc_info = None self.emit('error', crashreport.format_crash_report(when, exc_info, details))