Catch all exceptions when testing connectivity

Fixes issue #82