added a bunch of conditionals to make code for connections consistent for all protocols in terms of exceptions raised and error messages.