diff --git a/sksurgerynditracker/nditracker.py b/sksurgerynditracker/nditracker.py index f3655d9..286a433 100644 --- a/sksurgerynditracker/nditracker.py +++ b/sksurgerynditracker/nditracker.py @@ -88,8 +88,9 @@ def _get_serial_port_name(configuration): print("Probing port: ", serial_port, " got name: ", name, " Result: ", result, file=fileout) else: - raise IOError(f'Could not connect to serial port {serial_port} ' - f'as there are only {len(serial_ports)} ports available.' + raise IOError(f'Could not connect to serial port' + f'{serial_port} as there are ' + f'only {len(serial_ports)} ports available.' + serial_connection_errmsg) if isinstance(serial_port, str): @@ -97,9 +98,10 @@ def _get_serial_port_name(configuration): result = ndicapy.ndiProbe(name) print("Probing port: ", name, " Result: ", result, file=fileout) - + if result != ndicapy.NDI_OKAY: - raise IOError(f'Could not connect to an NDI device on the chosen port, {serial_port}.' + raise IOError(f'Could not connect to an NDI device on ' + f'the chosen port, {serial_port}.' + serial_connection_errmsg) return name