- except socket.timeout:
- logger.error('Socket timeout during execution of command: '
- '{0}\nBuffer content:\n{1}'.format(cmd, buf))
- raise Exception('Socket timeout during execution of command: '
- '{0}\nBuffer content:\n{1}'.format(cmd, buf))
+ except socket.timeout as exc:
+ raise_from(Exception(
+ 'Socket timeout during execution of command: '
+ '{0}\nBuffer content:\n{1}'.format(cmd, buf)), exc)