From 65a36579c4f5ad5c4018a0ebc058f553f1ae98c9 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 18 Apr 2012 15:46:31 +0300 Subject: [PATCH] londiste.handlers.dispatch: Detailed exception if part_field is NULL Give enough details to locate the event in queue --- python/londiste/handlers/dispatch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/londiste/handlers/dispatch.py b/python/londiste/handlers/dispatch.py index 95d08e72..6505736a 100644 --- a/python/londiste/handlers/dispatch.py +++ b/python/londiste/handlers/dispatch.py @@ -838,6 +838,8 @@ class Dispatcher(BaseHandler): dtm = datetime.datetime.now() elif self.conf.part_mode == 'date_field': dt_str = data[self.conf.part_field] + if dt_str is None: + raise Exception('part_field(%s) is NULL: %s' % (self.conf.part_field, ev)) dtm = datetime.datetime.strptime(dt_str[:19], "%Y-%m-%d %H:%M:%S") else: raise UsageError('Bad value for part_mode: %s' %\ -- 2.39.5