Friday Mar 07, 2008

Java API Exceptions - Argh!

Just stumbled again over one of the many stupid things in the Java API: if a socket connection cannot be established, you will get this exception:

java.net.ConnectException: Connection refused

Well, I see that it doesn't work, because nothing is happening. And I could guess the connection refused from a java.net.ConnectException. But what is the address and port that could not be reached??? This is some deep-down library call in a larger webapplication, so I have no clue what ip and port he is trying.

Why is it so difficult to provide an informative error message? This is running on the 5th edition of Java, 10 years in the wild... Sun is definitely bad on the developer usability part. Really.

Comments:

[Trackback]

Alex on API usability


Sun is definitely bad on the developer usability part. Really.


Eh Alex, when was the last time you had to...

Posted by Martin Probst's Weblog on March 07, 2008 at 08:51 PM CET #

No trackbacks?

manual trackback

Posted by Martin Probst on March 07, 2008 at 08:52 PM CET #

Oha, latency ;-)

Posted by Martin Probst on March 07, 2008 at 08:52 PM CET #

Post a Comment:
  • HTML Syntax: Allowed