'Return an error redirect.'

def _error_response(self, state, redirect_uri, as_fragment=False):

    resp = {'state': state}
    if ((errors.OAUTH2_ACCESS_DENIED, 'authorize') in c.errors):
        resp['error'] = 'access_denied'
    elif ((errors.INVALID_MODHASH, None) in c.errors):
        resp['error'] = 'access_denied'
    else:
        resp['error'] = 'invalid_request'
    final_redirect = _update_redirect_uri(redirect_uri, resp, as_fragment)
    return self.redirect(final_redirect, code=302)
