[JDEV] Extended error handling

Colin Madere colin at vedalabs.com
Wed Dec 6 19:16:08 CST 2000


Hello JDEV,

My group is currently extending the error reporting (and field requirements)
of the registration process in the Jabberd code.  We're implementing a
server and client that requires more fields than the default
(username/password) and we need to report more detailed errors for these
added fields.

Basically, we have something working but I don't think it's clean enough.
If there's suggestions, I'd like to hear them (on tag naming and hierarchy,
mainly).

Here's an example of a registration request error returned to the client
containing extended error codes for multiple fields:

<iq type='error' id='1002'>
   <query xmlns='jabber:iq:register'>
      <username>newuser</username>
      <email>spoon at fed.com</email>
      <password>babyfood</password>
	....possibly more fields here....
      <key>3be0ed5fa106e18761cb22baec2715baa60b217c</key>
   </query>
   <error code='xxx'>
      <field_error>
         <name>firstname</name>
         <errortype>nodata</errortype>
         <description>First name may not be left blank</description>
      </field_error>
      <field_error>
         <name>lastname</name>
         <errortype>nodata</errortype>
         <description>Last name may not be left blank</description>
      </field_error>
   </error>
</iq>

A standard error code looks like:

<error code='xxx'>Username not available</error>

What mainly bugs me is the <field_error/> section... 

** Also, any suggestions or resources for error codes?  Currently we're just
using arbitrarily chosen unused codes.

Colin Madere
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20001206/29fd2fd5/attachment-0002.htm>


More information about the JDev mailing list