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/DiffGzHandler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'patchtracker/DiffGzHandler.py') 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): -- cgit v1.2.3