def handle_error(exception, request=None):
    if request is None:
        request = {'_environ': {'PATH_INFO': ''}}

    if not getattr(exception, 'hide_traceback', False):
        (e_type, e_value, e_tb) = sys.exc_info()
        message = "%s occurred on '%s': %s\nTraceback: %s" % (
            exception.__class__,
            request._environ['PATH_INFO'],
            exception,
            ''.join(traceback.format_exception(e_type, e_value, e_tb))
        )
        request._environ['wsgi.errors'].write(message)

    if isinstance(exception, RequestError):
        status = getattr(exception, 'status', 404)
    else:
        status = 500

    if status in ERROR_HANDLERS:
        return ERROR_HANDLERS[status](request, exception)

    return not_found(request, exception)
Print application or deployment details.
dataset/ETHPy150Open toastdriven/itty/itty.py/handle_error--crossover with--dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.details