<s> import traceback <EOL> from flask import render_template , request <EOL> from breezeminder . app import app <EOL> from breezeminder . util . views import nocache <EOL> @ app . errorhandler ( <NUM_LIT> ) <EOL> @ nocache <EOL> def handle_404 ( error = None ) : <EOL> if error : <EOL> app . logger . error ( '<STR_LIT>' % request . path ) <EOL> context = { <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True <EOL> } <EOL> return render_template ( '<STR_LIT>' , ** context ) , <NUM_LIT> <EOL> @ app . errorhandler ( <NUM_LIT> ) <EOL> @ nocache <EOL> def handle_500 ( error = None ) : <EOL> if error : <EOL> app . logger . critical ( '<STR_LIT>' % ( request . path , error . message ) ) <EOL> app . logger . critical ( traceback . format_exc ( error ) ) <EOL> context = { <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True <EOL> } <EOL> return render_template ( '<STR_LIT>' , ** context ) , <NUM_LIT> <EOL> app . add_url_rule ( '<STR_LIT>' , '<STR_LIT>' , handle_404 ) <EOL> app . add_url_rule ( '<STR_LIT>' , '<STR_LIT>' , handle_500 ) </s>
