mozilla/socorro — pull request #321 by xni (2012-02-03 10:37:48+00:00)
Title: Wrap not exception-safe method call into try-except

Losing some data in the HBase causes to unhandled exception in the
threadLocalCrashStorage.get_meta() method. Futher code relies that
jsonDocument object is existing in the scope.

For example this is a sample from my log:

File "/data/socorro/application/socorro/processor/processor.py", line 618, in processJob
threadLocalCursor.execute("update reports \
set started_datetime = timestamp with time zone %s, \
completed_datetime = timestamp with time zone %s, \
success = False, \
processor_notes = %s \
where id = %s and \
date_processed = timestamp with time zone %s",
(startedDateTime, self.nowFunc(), message, reportId, date_processed))
UnboundLocalError: local variable 'reportId' referenced before assignment

because reportId depends on jsonDocument and it is defined a few lines after.