ISISComputingGroup / ISISComputingGroup/IBEX
genie: waitfor with missing arg give unclear to user error
- Dominant language
- No language data
- Stars
- 6
- Forks
- 2
- Avg merge
- 16h 40m
- Merged PRs (30d)
- 2
Description
On iris they entered `g.waitfor(1)` rather than `g.waitfor(uamps=1)` and had the error
```
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_api_setup.py", line 380, in decorator
return_value = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie.py", line 487, in waitfor
_genie_api.waitfor.start_waiting(
File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_waitfor.py", line 359, in start_waiting
if not self.api.block_exists(block):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_epics_api.py", line 524, in block_exists
return self.pv_exists(self.get_pv_from_block(name), fail_fast)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\genie_epics_api.py", line 807, in get_pv_from_block
return self.inst_prefix + self.block_prefix + block_name.upper()
^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'upper'
```
maybe we can make this a bit clearer - it looks like first arg would be a block name, so give better error if not a string type
## Acceptance cirteria
* command like `g.waitfor(1)` give a better error message e.g. `1 is not a valid block name`
Discussed 01:46:11 - in planning 02/10/25
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.