Handles exception if the port is in use

JFYI we adopted the convention of putting the `else` on a new line throughout the repo.