Catch exception thrown by blank port number