Say I have the following code:
logger = logging.getLogger(__name__)
def render_error(scr_msg, err_msg, context):
logger.debug(err_msg)
return render_to_response('error.html', {'message': scr_msg}, context)
...
def some_view():
try:
context = RequestContext(request)
...
except Exception as e:
return render_error('An error occured whilst showing some view.', e.args[0], context)
... then how do I handle the exception without a context? Should I use the render function instead of render_to_response in the exception handler?