Re: [gdome]Exception Codes again
- From: Paolo Casarini <casarini CS UniBO IT>
- To: Tobias Peters <tpeters uni-oldenburg de>
- Cc: gdome gnome org
- Subject: Re: [gdome]Exception Codes again
- Date: Mon, 7 Jan 2002 16:07:17 +0100 (CET)
On Mon, 7 Jan 2002, Tobias Peters wrote:
> Paolo wrote:
> > suggestions will be appreciated!
>
> But now I searched and learned that Exception codes in other modules do
> interfere with the Core Exception codes. Sorry, I should have done that
> before I wrote my last mail.
>
> This constant is not nececcary.
>
> What about:
>
> enum Core_Exception{... /* as currently implemented */)
> enum Event_Exception{UNSPECIFIED_EVENT_TYPE_ERR = 0};
> enum XPath_Exception{INVALID_EXPRESSION_ERR = 1,
> TYPE_ERR = 2};
> enum Exception_Type{CORE_EXCEPTION = 0 << 16,
> EVENT_EXCEPTION = 1 << 16,
> XPATH_EXCEPTION = 2 << 16};
> enum Exception_Masks{EXCEPTION_TYPE_MASK = 255 << 16,
> EXCEPTION_CODE_MASK = 65535};
>
> then, after a gdome function call
> if (exc != 0) {
> Gdome_Excpetion exc_type = exc & EXCEPTION_TYPE_MASK;
> Gdome_Excpetion exc_code = exc & EXCEPTION_CODE_MASK;
> switch(exc_type){
> case ...
> }
> }
>
> In some way, this would be compliant to the DOM recommendation, since
> (unsigned short)exc yields the correct exception code (with the IDL
> definition of unsigned short, being 16 bits, of course).
>
This is, in my opinion, a great solution! I'll implement it this
evening...
Thanx,
paolo.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]