Skip to content

Raise when the hardware connection fails instead of logging success - #206

Open
mikelangmayr wants to merge 2 commits into
mainfrom
mike/fix-false-connect-success
Open

mikelangmayr wants to merge 2 commits into
mainfrom
mike/fix-false-connect-success

Conversation

@mikelangmayr

Copy link
Copy Markdown
Contributor
  • the drivers report a failed connect by staying disconnected rather than raising, so _connect_hardware returned normally and on_start logged "Daemon started successfully and connected to hardware" on the line right after "Connection error: Connection timed out"
  • the same pattern was in all five daemons that connect this way: inficon, adc, lakeshore, atccryo, srsthermal
  • _connect_hardware now raises if the controller is not connected afterwards, so the existing except branch logs the failure and the "hardware is not available" warning, and initialize() is no longer called on a dead connection
  • this also fixes writes to isconnected, which previously reported success when the hardware was unreachable; they now return the error
  • verified with the hardware absent: lasterror reads "Failed to connect to hardware: no connection to :", a write to isconnected returns that error instead of ok, and with a connected controller initialize() still runs

@prkrtg

prkrtg commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Looks good, but it includes changes from #207?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants