error: Use more consistent details reporting
Always try and report summary + "\n\n" + details
This commit is contained in:
parent
e0bc2563c7
commit
f1c41b0866
|
@ -62,7 +62,7 @@ def _simple_async(callback, args, title, text, parent, errorintro,
|
|||
|
||||
error = errorintro + ": " + error
|
||||
parent.err.show_err(error,
|
||||
details=(error + "\n\n" + details))
|
||||
details=details)
|
||||
|
||||
# Displays a progress bar while executing the "callback" method.
|
||||
class vmmAsyncJob(vmmGObjectUI):
|
||||
|
|
|
@ -753,7 +753,7 @@ class vmmCloneVM(vmmGObjectUI):
|
|||
error = (_("Error creating virtual machine clone '%s': %s") %
|
||||
(self.clone_design.clone_name, error))
|
||||
self.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
else:
|
||||
self.close()
|
||||
self.conn.tick(noStatsUpdate=True)
|
||||
|
|
|
@ -1608,7 +1608,7 @@ class vmmCreate(vmmGObjectUI):
|
|||
if error:
|
||||
error = (_("Unable to complete install: '%s'") % error)
|
||||
self.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
self.failed_guest = self.guest
|
||||
return
|
||||
|
||||
|
|
|
@ -1119,7 +1119,7 @@ class vmmCreateInterface(vmmGObjectUI):
|
|||
if error:
|
||||
error = _("Error creating interface: '%s'") % error
|
||||
self.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
else:
|
||||
# FIXME: Hmm, shouldn't we emit a signal here rather than do this?
|
||||
self.conn.tick(noStatsUpdate=True)
|
||||
|
|
|
@ -402,7 +402,7 @@ class vmmCreatePool(vmmGObjectUI):
|
|||
if error:
|
||||
error = _("Error creating pool: %s") % error
|
||||
self.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
else:
|
||||
self.close()
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ class vmmCreateVolume(vmmGObjectUI):
|
|||
if error:
|
||||
error = _("Error creating vol: %s") % error
|
||||
self.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
else:
|
||||
self.emit("vol-created")
|
||||
self.close()
|
||||
|
|
|
@ -822,7 +822,7 @@ class vmmEngine(vmmGObject):
|
|||
if error is not None:
|
||||
error = _("Error saving domain: %s") % error
|
||||
src.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
|
||||
def _save_cancel(self, asyncjob, vm):
|
||||
logging.debug("Cancelling save job")
|
||||
|
@ -871,7 +871,7 @@ class vmmEngine(vmmGObject):
|
|||
if error is not None:
|
||||
error = _("Error restoring domain: %s") % error
|
||||
src.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
|
||||
def _restore_saved_callback(self, asyncjob, file_to_load, conn):
|
||||
ignore = asyncjob
|
||||
|
|
|
@ -67,7 +67,12 @@ class vmmErrorDialog (object):
|
|||
logging.debug("dialog message: %s : %s" % (summary, details))
|
||||
|
||||
if details is None:
|
||||
details = "".join(traceback.format_exc())
|
||||
details = summary + "\n\n" + "".join(traceback.format_exc())
|
||||
|
||||
# Make sure we have consistent details for error dialogs
|
||||
if (dialog_type == gtk.MESSAGE_ERROR and not
|
||||
details.count(summary)):
|
||||
details = summary + "\n\n" + details
|
||||
|
||||
dialog = _errorDialog(parent=self.get_parent(),
|
||||
type=dialog_type, buttons=buttons)
|
||||
|
|
|
@ -462,7 +462,7 @@ class vmmMigrateDialog(vmmGObjectUI):
|
|||
if error:
|
||||
error = _("Unable to migrate guest: %s") % error
|
||||
self.err.show_err(error,
|
||||
details=(error + "\n" + details))
|
||||
details=details)
|
||||
else:
|
||||
self.conn.tick(noStatsUpdate=True)
|
||||
destconn.tick(noStatsUpdate=True)
|
||||
|
|
|
@ -310,6 +310,8 @@ class vmmStorageBrowser(vmmGObjectUI):
|
|||
vol.get_format() or "", namestr])
|
||||
|
||||
def show_err(self, info, details=None):
|
||||
self.err.show_err(info, details, async=False)
|
||||
self.err.show_err(info,
|
||||
details=details,
|
||||
async=False)
|
||||
|
||||
vmmGObjectUI.type_register(vmmStorageBrowser)
|
||||
|
|
Loading…
Reference in New Issue