Translate socket.error to our exception type.