Use ErrorController.getErrorPath() to ignore the error path for security

Fixes gh-1548 again