adds an else block for unsuccessful connets

I'm totally not sure if this might be bug, it came to my attention
when a user in the forums hat a stacktrace resulting from an None
value in `connection_parameters.client_id`.