exceptions in GnomeUIHandler



Hi,

After kicking myself a lot for apparently writing buggy code, it
turns out my problem was that the implementation of
menu_get_attributes didn't set an exception where it had to. 

The following quick patch fixes it, but I was thinking that instead
of using a system exception, the idl, maybe the idl should be changed
to add the MenuItemNotFound exception to all the applicable functions.

Also, why is there both a MenuItemNotFound and a ToolbarItemNotFound
exception while both are actually pretty much the same. A PathNotFound
exception sounds like a reasonable name to me.

So, to get a better patch approved, do I add more exceptions to the
IDL, and should I change both exceptions into one or just keep using
the two existing ones?

Martijn

-- 
Martijn van Beers  <martijn@earthling.net>

'Don't worry if it sounds odd. Believe me, you are talking to
someone who has seen a lot of stuff that is odd. And I don't
mean biscuits.' --- Arthur Dent
? lotr-exception-1.diff
? testje
? .gnome-ui-handler.c.swp
? guppi2/NO-AUTO-GEN
? guppi2/guile-server/NO-AUTO-GEN
Index: gnome-ui-handler.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/gnome-ui-handler.c,v
retrieving revision 1.44
diff -u -r1.44 gnome-ui-handler.c
--- gnome-ui-handler.c	2000/01/06 12:23:33	1.44
+++ gnome-ui-handler.c	2000/01/22 21:00:33
@@ -5411,7 +5411,8 @@
 	internal = menu_toplevel_get_item (uih, path);
 
 	if (internal == NULL) {
-		/* FIXME: Set exception. */
+		CORBA_exception_set_system (ev, ex_CORBA_BAD_PARAM,
+					    CORBA_COMPLETED_NO);
 		return;
 	}
 


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