Either way (a hierarchy of exceptions or a single exception with error
codes) is OK by me.

Note that there is a definite limit on how detailed exceptions can be in
this kind of API. If you've ever used ODBC, you've undoubtedly noticed
that drivers vary wildly in how accurate the returned SQLSTATEs are --
many driver vendors simply refused to go into detail, either because
they couldn't get the information from the database or because it was
simply too complex.

With respect to the codes below, what is the difference between "NoSuch"
and "Invalid"?

-- Ron

Kimbro Staken wrote:
> 
> I'm currently working on a new update for the API. I'm looking to add
> exceptions back in and wanted to get some feedback on how this should
> work. My preference is for a hierarchy of detailed exceptions however
> IDL does not allow Exception inheritence which makes that difficult. So
> this is what I'm currently looking at.
> 
>    enum ErrorCodes {
>       VendorError,
>       WrongContentType,
>       NoSuchService,
>       InvalidService,
>       NoSuchCollection,
>       PermissionDenied,
>       InvalidResource,
>       NoSuchResource,
>       InvalidCollection,
>       InvalidDatabase,
>       NoSuchDatabase
>    };
> 
>    exception XMLDBException {
>       string message;
>       ErrorCodes errorCode;
>       long vendorErrorCode;
>    };
> 
> There is just one exception that is declared to be thrown by all methods
> but contains a detailed ErrorCode. If the errorCode field is set to
> ErrorCodes.VendorError then the exception is vendor specific and the
> vendorErrorCode should be consulted.

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact adminstrator:   mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to