Closed ZLLentz closed 6 years ago
If you try to connect to a daq with the correct platform, but the daq is not allocated, you get:
pdsdaq_connect(): get dbpath len = 0
INFO Failed to connect to DAQ - check that it is up and allocated.
Where the print statement comes from pydaq
when we talk to "something" but get no data back. The message on the exception object is 'Initial query failed'
. (str(err)
to access the message)
If you have the wrong platform, you just get:
INFO Failed to connect to DAQ - check that it is up and allocated.
If you have the right platform but the daq is down, you also get:
INFO Failed to connect to DAQ - check that it is up and allocated.
And the exception's message is 'Connect failed'
So we can pinpoint the error for when the daq isn't allocated. This can become part of a PR. However, for the platform being wrong vs daq down there is actually no difference in python.
So the options are:
wheredaq
is a good candidate but it doesn't seem to be accurate in SXR for some reason... but if it did, we could also warn the user about which machine the daq is running on)Actually, scanning all the platforms seems... not unreasonable. @teddyrendahl can you think of an obvious reason why this would break things? Was all this platform config unneeded?
I've already implemented the scanning and will make a PR. For me the big advantage here was that I no longer have to find a reasonable error message for having the wrong platform, since connecting to the wrong daq and there not being a daq to connect to look exactly the same. So now there are two very clear error messages:
This is a copied issue from https://github.com/pcdshub/pcdsdevices/issues/154
Expected Behavior
If
daq.connect()
fails, it should always give a helpful error message.Current Behavior
Abdullah observed the following response today:
Possible Solution
Go to a hutch, find some common failure states (wrong
platform
, daq not allocated), see what the response is inside the code. Make sure we catch these and give proper error messages.Steps to Reproduce (for bugs)
Context
This bug creates extra debugging time when something goes wrong in the setup of a
Daq
class.Your Environment
pcds-0.5.2