Skip to content

Commit 66f4b51

Browse files
committed
Report disconnect via IllegalStateException like CA
1 parent 70cb21e commit 66f4b51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/pva/src/main/java/org/epics/pva/client/PVAChannel.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ PVAClient getClient()
8686
ClientTCPHandler getTCP() throws Exception
8787
{
8888
final ClientTCPHandler copy = tcp.get();
89+
90+
// Channel Access reacts to read/write access while disconnected
91+
// via IllegalStateException("Channel not connected.")
92+
// Use the same exception, but add channel name
8993
if (copy == null)
90-
throw new Exception("Channel '" + name + "' is not connected");
94+
throw new IllegalStateException("Channel '" + name + "' is not connected");
9195
return copy;
9296
}
9397

0 commit comments

Comments
 (0)