Catch the exceptions during starting server.