- try:
- super().connect(host, port)
- # Catch socket errors
- except OSError as err:
- raise PlayerError(f'Could not connect to "{host}:{port}": {err.strerror}'
- ) from err
- # Catch all other possible errors
- # ConnectionError and ProtocolError are always fatal. Others may not
- # be, but we don't know how to handle them here, so treat them as if
- # they are instead of ignoring them.
- except MPDError as err:
- raise PlayerError(f'Could not connect to "{host}:{port}": {err}') from err