Question about Smack Exceptions

Just out of curiousity why do XMPPException throw a number rather than just print the verbiage of the problem?

I then have to go to the JavaDoc and look up what the error is.

What not just print the error in the first place?

For example instead of printing 409, why not just print “duplicate username in chat room”.

It is annoying.

You can use the XMPPException to create an XMPPError. Using this object you can then get a description of the exception encountered.

XMPPException e;

XMPPError err = e.getXMPPError();

// do something with the error

System.out.println(err.getCode();

System.out.println(err.getMessage();

/code

hth

Jon

Message was edited by: JonWright