[damned-lies] Add error in exception message in update-stats



commit df1e0cec930ab1a380c5ca4c377d94db62ed267c
Author: Claude Paroz <claude 2xlibre net>
Date:   Wed Dec 18 16:55:31 2013 +0100

    Add error in exception message in update-stats

 stats/management/commands/update-stats.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/stats/management/commands/update-stats.py b/stats/management/commands/update-stats.py
index 8f8745f..ab9be67 100644
--- a/stats/management/commands/update-stats.py
+++ b/stats/management/commands/update-stats.py
@@ -66,9 +66,9 @@ class Command(BaseCommand):
             for branch in module.branch_set.all():
                 try:
                     branch.update_stats(options['force'])
-                except Exception:
-                    raise CommandError("Error while updating stats for %s (branch '%s')" % (
-                        module.name, branch.name))
+                except Exception as exc:
+                    raise CommandError("Error while updating stats for %s (branch '%s'): %s" % (
+                        module.name, branch.name, exc))
         else:
             # Update all modules
             if options['non-gnome']:
@@ -84,8 +84,8 @@ class Command(BaseCommand):
                 for branch in branches.all():
                     try:
                         branch.update_stats(options['force'])
-                    except Exception:
-                        raise CommandError("Error while updating stats for %s (branch '%s')" % (
-                            mod.name, branch.name))
+                    except Exception as exc:
+                        raise CommandError("Error while updating stats for %s (branch '%s'): %s" % (
+                            mod.name, branch.name, exc))
 
         return "Update completed.\n"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]