From 965a7af0fe6ce951bbf867b39379a23a6684e957 Mon Sep 17 00:00:00 2001 From: sean finey Date: Thu, 12 Feb 2009 23:08:19 +0100 Subject: 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. --- patchtracker/ReqHandler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'patchtracker/ReqHandler.py') 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() -- cgit v1.2.3