Ignore common connection errors.
Refactor into a harmless connection func to ease testing of error conditions.
Add test for harmless error function.
Merging #173.