def handle_awful_failure(fail_text): """ Makes sure that no errors generated in the error handler percolate up to the user unless debug is enabled. """ if g.debug: import sys s = sys.exc_info() # reraise the original error with the original stack trace raise s[1], None, s[2] try: # log the traceback, and flag the "path" as the error location 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: # we are doomed. Admit defeat return "This is an error that should never occur. You win."
def handle_awful_failure(fail_text): """ Makes sure that no errors generated in the error handler percolate up to the user unless debug is enabled. """ if g.debug: import sys s = sys.exc_info() # reraise the original error with the original stack trace raise s[1], None, s[2] try: # log the traceback, and flag the "path" as the error location import traceback log.write_error_summary(fail_text) for line in traceback.format_exc().splitlines(): g.log.error(line) return redditbroke % (make_failien_url(), fail_text) except: # we are doomed. Admit defeat return "This is an error that should never occur. You win."