directive for route error handling