Catch a connection failure if you can't get the last error from shard.

Should fix #280
I wonder if we should be more specific in here, and catch the string "could not get last error from shard" instead.