Add exception handling for router CGI test