Skip to content

genie: waitfor with missing arg give unclear to user error #8850

@FreddieAkeroyd

Description

@FreddieAkeroyd

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions