Skip to content

Add an optional throw parameter to put/set

Make the throw= parameter available. There are different way to handle a failing put()/set():

  • pyepics returns a return value on put() returning success or not.
  • p4p throws by default an exeception. If called with throw=false there in a return value, which is the "not thrown" exception or None
  • pyads throws an exeption if things go wrong

While there is good and bad with all solutions, there is a value in having throw=something in the user code:

Most often the return value of the put() is ignored, and the code continues even if a put() failed instead of aborting

Sometimes it is desirable to handle a failed put() early in the test-code: When a put() fails, the test can be aborted early and is not doing the wrong things. There may be cases where the test case should be skipped, since a variable with this name does not exist and the test does not make sense at all.

In short: Make the throw=throw available.

Changes to be committed: modified: ConnADS.py modified: ConnCA.py modified: ConnP4P.py

Merge request reports

Loading