Skip to content

add a hint list to help user understand the wetest error #85

@vnadot

Description

@vnadot

WeTest errors are not very user-friendly. For example (they are many examples):

for this test:

    - name:       "enable PV put (DISP EPICS field)"
      setter:     "SL-SCL-CM1:RF-RFFI-1:GenDriverScanSet.DISP"
      set_value:  "0"

I got this error message

ERROR: test-0-0-1 (wetest.testing.generator.SelectableTestCase)
enable PV put: enable PV put (DISP EPICS field)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/generator.py", line 438, in test
    setter.put(set_value)
  File "/iee/extensions/lib/python/pyepics-3.2.4-py2.7.egg/epics/pv.py", line 336, in put
    return ca.put(self.chid, value,
  File "/iee/extensions/lib/python/pyepics-3.2.4-py2.7.egg/epics/ca.py", line 403, in wrapper
    return fcn(*args, **kwds)
  File "/iee/extensions/lib/python/pyepics-3.2.4-py2.7.egg/epics/ca.py", line 1329, in put
    PySEVCHK('put', ret)
  File "/iee/extensions/lib/python/pyepics-3.2.4-py2.7.egg/epics/ca.py", line 432, in PySEVCHK
    raise CASeverityException(func_name, message(status))
epics.ca.CASeverityException:  put returned 'Invalid element count requested'

The reason is because of a type error (see #84). Setting set_value: 0 in my case fix the issue.

I propose to add some hints after an error message. In this specific case it could be: type mismatch: try to set a string in int type

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions