eclipse-ee4j / eclipse-ee4j/tyrus

Improved exceptions?

Open
#577 7 comments 0 reactions 0 assignees View on GitHub
Component: client Priority: Major Type: Improvement
Dominant language
Java
Stars
128
Forks
49
PR merge metrics
No merged PRs in 30d

Description

As a developer, I'm certain you can understand the pain a poorly articulated exception causes. It's like when a user opens up a ticket and says "Hey, it doesn't work." The following exception is without meaning and serves no purpose other than spitting up blood.

Caused by: javax.websocket.DeploymentException: Handshake response not received.
at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:655)
at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:673)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:826)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:496)
at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:348)

I'm able to connect to the server using ws://localhost:8080/context/endpoint without an issue but the Tyrus client simply throws a worthless error message without any meaningful information.

e.g., can it not find the host? (In this case it should), Is it connected but not getting any response back? (Not being connected since @OnOpen isnt called), and the list goes on.

I started to look at ClientManager#connectToServer but after trying to read 200 lines of code with nested anonymous classes, inline versions of classes with different implementations, etc. I thought I was watching the assembling of Franklinstein with all the things being hacked together in a single method.
#### Affected Versions
[1.10]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.