You can't redirect after response.sendError

Once sendError has been called the response is committed and no
further redirect is possible.