10-05-2012 03:59 PM
The class net.authorize.util.HttpClient in the Java SDK which is used to post request to Authorize.NET swallows several exceptions (I/O, etc) which my be created during the post, so outer code doesn't know what happened, or have a chance to recover from the failure.
In other places it logs the error to System.err (using e.printStackTrace()), which has the same effect. The client doesn't have a chance to know what went wrong, or doesn't know that something went wrong.
After manually inducing these error conditions, we found that in some cases it results in a RuntimeException because of a NullPointer caused by this poor exception handling.
Examples of these issues may be seen in the methods executeXML and convertStreamToString. I can provide more specifics if necessary. Fixing these problems will help SDK users to write more robust code.
10-15-2012 10:26 AM
Thanks for your input on the Java SDK. I've passed on your suggestion to the development team consideration in a future release.