def reject(response: Response, reason: str) -> None: """ Complete request handling pipeline with an appropriate error. """ http_status = falcon.HTTP_403 response.text = json.dumps({ 'errors': [ { "title": "CSRF error", "detail": str(reason), 'status': "Forbidden", 'code': http_status, }, ], }) response.status = http_status response.complete = True