Raising an exception when the server could not be contacted

@mpdavis please review