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/ReqHandler.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/ReqHandler.py')
-rwxr-xr-x | patchtracker/ReqHandler.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/patchtracker/ReqHandler.py b/patchtracker/ReqHandler.py index a41114f..a87fd68 100755 --- a/patchtracker/ReqHandler.py +++ b/patchtracker/ReqHandler.py @@ -6,7 +6,7 @@ import sys import patchtracker.Conf as Conf from patchtracker.Templates import ErrorTemplate, PatchTemplate, PackageVersTemplate, LetterTocTemplate, FrontPageTemplate, SearchResultsTemplate -from patchtracker.DiffGzHandler import DiffGzHandler +from patchtracker.DiffGzHandler import DiffGzHandler, DiffGzException import patchtracker.DB as DB from patchtracker.DB import PatchTrackerDB import pygments @@ -182,4 +182,7 @@ class CmdHandler: self.status = self.cmd.status def output(self): - return self.cmd.output() + try: + return self.cmd.output() + except DiffGzException, e: + return ErrorCmd(str(e), "500 Oh Noez!!1!").output() |