Most tab handlers call self.i.write() or query methods directly and rely on exception handling if the instrument is not connected.
Why this is a problem
Technically this works, because the exception is caught and logged, but the UI still allows actions that are guaranteed to fail.
That makes the tool feel rougher than necessary and creates avoidable error spam.
Fix approach
Add a helper such as:
def_require_connected(self)->bool:ifnotself.i.sock:self.logln("[ERR] Not connected")returnFalsereturnTrue
and call it at the top of handlers that require an active instrument connection.
Optional follow-up:
disable relevant controls while disconnected
re-enable them after successful connect
Status
Still open.
Not fixed in the current v0.2 working copy.
### Problem
Most tab handlers call `self.i.write()` or query methods directly and rely on exception handling if the instrument is not connected.
### Why this is a problem
Technically this works, because the exception is caught and logged, but the UI still allows actions that are guaranteed to fail.
That makes the tool feel rougher than necessary and creates avoidable error spam.
### Fix approach
Add a helper such as:
```python
def _require_connected(self) -> bool:
if not self.i.sock:
self.logln("[ERR] Not connected")
return False
return True
```
and call it at the top of handlers that require an active instrument connection.
Optional follow-up:
- disable relevant controls while disconnected
- re-enable them after successful connect
### Status
Still open.
Not fixed in the current v0.2 working copy.
tgohle
self-assigned this 2026-04-17 12:09:17 +00:00
tgohle
changed title from No central connection-state guard on tab actions to [Task]: No central connection-state guard on tab actions2026-04-18 11:20:59 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Most tab handlers call
self.i.write()or query methods directly and rely on exception handling if the instrument is not connected.Why this is a problem
Technically this works, because the exception is caught and logged, but the UI still allows actions that are guaranteed to fail.
That makes the tool feel rougher than necessary and creates avoidable error spam.
Fix approach
Add a helper such as:
and call it at the top of handlers that require an active instrument connection.
Optional follow-up:
Status
Still open.
Not fixed in the current v0.2 working copy.
No central connection-state guard on tab actionsto [Task]: No central connection-state guard on tab actions