NEXUS-6169: fix porting problem, use response.sendError()