Continuation of bug #4171. We should display a different error message depending on whether it was the master or agent that the client failed to connect to.