storing the correct error message to an exception
doesn't work sometimes.
example code:
<python test script>
import IO
d = IO.AnalogInput( "reseda/hp54602b_2/freq" )
try:
d.read( ) # leads to execution denied exception
except:
print "e"
d.deviceOn( ) # no exception
d.read( ) # leads to execution denied exception, too
</python test script>
the last line will NOT show an execution denied error
message as expected. it is a exception with error type
EXECUTION_DENIED, but not with the appropriate error
message, as defined in TACOBasicErrors.h.
the example output from the server while executing the
script is:
<output>
EN: 4010
ES: Execution denied # that's ok, the the device is off
EN: 4020
ES: could not write to gpib card register
# that's also ok, it is a internal gpib exception
EN: 4010
ES: could not write to gpib card register
# that's NOT ok, as it is a exception of type execution
denied and should return the correct error message!
</output>
we tracked the problem down to an internal function
called 'get_error_string', called by 'dev_error_string'
in TACOException.cpp to retrieve the error code.
It looks like that the global error string variable
('char *dev_error_string') has an old error message
which has not been cleared.
see lib/gen_api.c around line 1878.