Re: [gdome]Exception Codes again



On Sat, 5 Jan 2002, Tobias Peters wrote:

> Dear Paolo and other contributors,
> 
> the exception tracking variable with (GdomeException)(-1).  I now use -1
> instead of 0, which I used earlier for this purpose, because 0 is already
> in use:  It indicates UNSPECIFIED_EVENT_TYPE_ERR in the `events' module.

Implementing an "Exception system" with C we have to make manage some
problems that languages like C++ and Java don't have. We have to manege
different kind of Exceptions: Exception, EventException and so on...

First of all I've set UNSPECIFIED_EVENT_TYPE_ERR as 0 as DOM Level 2 spec
declare for EventException, but 0 is the right code for no Exception
raised by Core API functions. So we have to manage with different kind of
exceptions but I don't want to add new parameters for all kind of
exception a function could return: in particular I don't want to have
prototypes like
   gdome_doc_xxx (param1, param2, GdomeException, GdomeEventException, ..)

So I thought to implement all Exception types in only one gulong
variables. So we can have 256 availables possible codes for each kind of
Exceptions.

Examples:
0 no core exception
1 the first core exception
2 ...
...
256 no event exception
257 the first event exception
258...
...
and so on....

any other implementation that deal with different kind of exception in
only one variables are possible...

suggestions will be appreciated!

Thanx,
  paolo.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]