tests: add test for error handler in route

closes #2228