diff options
author | sean finey <seanius@debian.org> | 2009-02-12 23:08:19 +0100 |
---|---|---|
committer | sean finey <seanius@debian.org> | 2009-02-12 23:08:19 +0100 |
commit | 965a7af0fe6ce951bbf867b39379a23a6684e957 (patch) | |
tree | 99161591ed25b3658a2bb22c912c2021fd9d6ec6 /patchtracker/DiffGzHandler.py | |
parent | a6d05c5f6f1de8a9e0e43264624038c0f3f24cfb (diff) | |
download | patch-tracker-965a7af0fe6ce951bbf867b39379a23a6684e957.tar.gz |
fail more gracefully if a diff.gz is missing
this should never happen in production as the database contains
only a cache of what's on disk, but during testing on a system with
the database and no archive, or in unexpected circumstances, it
might be helpful to give a more informative error page.
Diffstat (limited to 'patchtracker/DiffGzHandler.py')
-rw-r--r-- | patchtracker/DiffGzHandler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/patchtracker/DiffGzHandler.py b/patchtracker/DiffGzHandler.py index 1f1c1de..96d862b 100644 --- a/patchtracker/DiffGzHandler.py +++ b/patchtracker/DiffGzHandler.py @@ -3,6 +3,9 @@ import sys import os from Patch import Patch, PatchSeries +class DiffGzException(Exception): + pass + class DiffGzHandler: diff = None def __init__(self,fname): @@ -21,7 +24,7 @@ class DiffGzHandler: p = Patch(o) err = e.read() if len(err): - raise Exception("filterdiff gave errors:",err) + raise DiffGzException("filterdiff gave errors: "+err) return p def debiandir(self): |