throw informative exception on bad port number