def handle_awful_failure(fail_text):
 if g.debug:
  import sys
  s = sys.exc_info()
  raise s[1], None, s[2]
 try:
  import traceback
  log.write_error_summary(fail_text)
  for line in traceback.format_exc().splitlines():
   g.log.error(line)
  return (redditbroke % (make_failien_url(), websafe(fail_text)))
 except:
  return 'This is an error that should never occur.  You win.'

def handle_awful_failure ( fail_text ) : if g . debug : import sys s = sys . exc_info ( ) raise s [ 1 ] , None , s [ 2 ] try : import traceback log . write_error_summary ( fail_text ) for line in traceback . format_exc ( ) . splitlines ( ) : g . log . error ( line ) return ( redditbroke % ( make_failien_url ( ) , websafe ( fail_text ) ) ) except : return 'This is an error that should never occur.  You win.'
makes sure that no errors generated in the error handler percolate up to the user unless debug is enabled .