mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 05:30:44 +00:00
instrument/daq: Provide available devices in error message
Display available daq devices in error message if requested device is unavailable.
This commit is contained in:
parent
f2a88fd1dc
commit
150fe2b32b
@ -60,7 +60,8 @@ class DaqInstrument(Instrument):
|
|||||||
result = self.execute('list_devices')
|
result = self.execute('list_devices')
|
||||||
if result.status == Status.OK:
|
if result.status == Status.OK:
|
||||||
if device_id not in result.data:
|
if device_id not in result.data:
|
||||||
raise ValueError('Device "{}" is not found on the DAQ server.'.format(device_id))
|
msg = 'Device "{}" is not found on the DAQ server. Available devices are: "{}"'
|
||||||
|
raise ValueError(msg.format(device_id, ', '.join(result.data)))
|
||||||
elif result.status != Status.OKISH:
|
elif result.status != Status.OKISH:
|
||||||
raise HostError('Problem querying DAQ server: {}'.format(result.message))
|
raise HostError('Problem querying DAQ server: {}'.format(result.message))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user