timestamp: do not traceback on timestamping error, just log them
This commit is contained in:
parent
b40c86cc2d
commit
c3b2d05505
|
@ -15,7 +15,10 @@ def timestamp_json(json_dict):
|
|||
s = simplejson.dumps(json_dict)
|
||||
if s[-1] != '}':
|
||||
raise ValueError("timestamp_json takes a dictionnary as argument: %s" % s)
|
||||
tst, error = timestamp(s)
|
||||
try:
|
||||
tst, error = timestamp(s)
|
||||
except Exception, e:
|
||||
raise RuntimeError("unable to communicate with timestamping service", e)
|
||||
if tst:
|
||||
return s[:-1] + ',"timestamp": "%s"}' % tst.encode('base64').strip()
|
||||
else:
|
||||
|
|
|
@ -229,7 +229,10 @@ def send_file(request):
|
|||
'have been informed.'))
|
||||
else:
|
||||
blob = new_send.timestamp_blob()
|
||||
tst = timestamp.timestamp_json(blob)
|
||||
try:
|
||||
tst = timestamp.timestamp_json(blob)
|
||||
except (ValueError, RuntimeError), e:
|
||||
tst = "Error: %r" % str(e)
|
||||
logger.info('sent %s, timestamp %s' % (new_send, tst))
|
||||
msg = ungettext(
|
||||
'New document sent to %d recipient.',
|
||||
|
|
Loading…
Reference in New Issue