Sorry, but I think the best thing is that I tell you my current problem:   I
don't remember C++ (I just programmed only once a couple of years ago) but
in several object oriented languages, there is the concept of error handling
using exceptions. And of course, this is the case of Smalltalk. I hope you
know what exceptions are so that you can understand what I need.

The thing is that from my code (SqueakDBX) or even from the user of
SqueakDBX I would like to do a certain action depending on the error I got.
But right now, I have no way to identify uniquely an error. The only thing I
can do is to obtain a -1 and then the description. But I don't want to
depend on that to identify a particular error type. Because if tomorrow the
description change....So, what I would love is to uniquely identify an error
in ALL of the OpenDBX library. Something like this:

Error code   |    Error number   |    Description
NO_MEMORY   |    0   |    There is no memory left
LIBRARY_OPEN  | 1  | OpenDBX could load the library backend
..... | .... | ....

So, it doesn't matter which handle I have, I know every time I get a
NO_MEMORY it means that ...
So, with this, I can have decisions in my code and decide what to do in
different error situations.

Do you understand this problem? do you think OpenDBX can do something like
this in a future release? does this make sense for you ?


Cheers,

Mariano


On Tue, Sep 29, 2009 at 6:57 PM, Mariano Martinez Peck <
marianop...@gmail.com> wrote:

> Norbert: I have a question. Although I am almost sure about the answer ;)
>
> The question is: when I have an error with OpenDBX I can then call
> odbx_error() to obtain the description. The thing is, is that error number
> unique? I mean, if I have an error number -3 with the description "XXX"
> every time I get a -3 the description will be "XXX"? or...perhaps after
> certain function invocation -3 can mean "XXX" and with other function it can
> mean "YYY" ?
>
> Thanks
>
> Mariano
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
libopendbx-devel mailing list
libopendbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopendbx-devel
http://www.linuxnetworks.de/doc/index.php/OpenDBX

Reply via email to