summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeControler.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-01-11 14:51:46 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-01-11 14:51:46 +0100
commit36181d34a93864336da6ccd22402ebab37f79778 (patch)
tree510145301639214d11f40ef1cd6fc3cd308cf9da /DistUpgrade/DistUpgradeControler.py
parent37bb800eeb2d1d80836392b1b2f3d832882e7b01 (diff)
downloadpython-apt-36181d34a93864336da6ccd22402ebab37f79778.tar.gz
* extended error reporting implemented
Diffstat (limited to 'DistUpgrade/DistUpgradeControler.py')
-rw-r--r--DistUpgrade/DistUpgradeControler.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 135b93aa..b27e3926 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -271,11 +271,15 @@ class DistUpgradeControler(object):
self.cache._list.ReadMainList()
progress = self._view.getFetchProgress()
try:
- self.cache.update(progress)
+ res = self.cache.update(progress)
except IOError, e:
- # FIXME: this can result in insanly big dialogs,
- # need to elpise/cut e
- self._view.error(_("Error during commit:"), e)
+ self._view.error(_("Error during update"),
+ _("A problem occured during the update. "
+ "This is usually some sort of network "
+ "problem, please check your network "
+ "connection and retry."), e)
+ return False
+ return res
def askDistUpgrade(self):
try:
@@ -302,7 +306,16 @@ class DistUpgradeControler(object):
def doDistUpgrade(self):
fprogress = self._view.getFetchProgress()
iprogress = self._view.getInstallProgress()
- self.cache.commit(fprogress,iprogress)
+ try:
+ res = self.cache.commit(fprogress,iprogress)
+ except IOError, e:
+ self._view.error(_("Error during commit"),
+ _("Some problem occured during the upgrade. "
+ "This is mostly a network problem, please "
+ "check the network and try again. "),
+ e)
+ return False
+ return res
def doPostUpgrade(self):
self.openCache()
@@ -323,12 +336,7 @@ class DistUpgradeControler(object):
self.cache.getChanges(), 0):
fprogress = self._view.getFetchProgress()
iprogress = self._view.getInstallProgress()
- try:
- self.cache.commit(fprogress,iprogress)
- except IOError, e:
- # FIXME: this can result in insanly big dialogs,
- # need to elpise/cut e
- self._view.error(_("Error during commit:"), e)
+ self.cache.commit(fprogress,iprogress)
def askForReboot(self):
return self._view.askYesNoQuestion(_("Reboot required"),