connection: try to better catch errors while sending commands