@contextlib.contextmanager
def save_and_reraise_exception():
 (type_, value, tb) = sys.exc_info()
 try:
  (yield)
 except Exception:
  logging.error(_('Original exception being dropped: %s'), traceback.format_exception(type_, value, tb))
  raise
 raise type_, value, tb

@ contextlib . contextmanager def save_and_reraise_exception ( ) : ( type_ , value , tb ) = sys . exc_info ( ) try : ( yield ) except Exception : logging . error ( _ ( 'Original exception being dropped: %s' ) , traceback . format_exception ( type_ , value , tb ) ) raise raise type_ , value , tb
save current exception .