Monday, May 04, 2009

API/Web Service Enhancement: Two choices for error messages

Users of JangoMail's API / Web Service now have two choices for the format of error messages. Typically, errors thrown by the API result in a plain string, or a .Net exception for those programming on the .Net platform.

As a result of a request of a current client, you can now choose to have XML formatted errors instead. Because we anticipate that this feature will be rarely used, we have not added a screen in the web interface to toggle between the two settings. However, if you do wish to change your API error formatting, just contact Support and we'll make the change to your account for you.

Example of standard .Net-based exception:

JangoMailNamespace.InvalidEmailAddressException: Web Service Exception InvalidEmailAddressException: E-mail address is invalid.
at JangoMailNamespace.JangoMail.GetFailureMessage(Int32 UserID, String MethodName, Exception ex)
at JangoMailNamespace.JangoMail.SendTransactionalEmail(String Username, String Password, String FromEmail, String FromName, String ToEmailAddress, String ToHeader, String ContentType, String Subject, String MessagePlain, String MessageHTML, String RawMessage, String Options)
at JangoMailNamespace.JangoMail.SendTransactionalEmail(String Username, String Password, String FromEmail, String FromName, String ToEmailAddress, String Subject, String MessagePlain, String MessageHTML, String Options)


Example of XML-based exception: