[PATCH] oaf && bonobo activation errors



these patches make my life as a shlib component author easier.

if there is a way for the oaf moniker to report the error in a better
way?  i am not too familiar with exceptions.

anyway this prints out fun messages like:

Message: OAF error activating component: g_module_open of
'libGNOME_FileSelector.so' failed: /gnome/lib/libGNOME_FileSelector.so:
undefined symbol: POA_GNOME_FileSelector__init

instead of just:

Bonobo-WARNING **: Activation exception 'Unknown CORBA exception id:
'IDL:OAF/GeneralError:1.0''

(should that really be a warning?)

anyway, it'd be nice to get this into the new oaf and bonobo if they
haven't gone out yet.

jacob
-- 
"OOH!!!  Look at me!!  I'm Jacob Berkman!  I have a witty .signature
 that nobody fully appreciates but myself!!"  -- Anonymous

Index: oaf/liboaf/oaf-plugin.c
===================================================================
RCS file: /cvs/gnome/oaf/liboaf/oaf-plugin.c,v
retrieving revision 1.13.4.2
diff -u -r1.13.4.2 oaf-plugin.c
--- oaf/liboaf/oaf-plugin.c	2001/05/08 22:31:01	1.13.4.2
+++ oaf/liboaf/oaf-plugin.c	2001/08/09 23:34:00
@@ -94,7 +94,8 @@
                         char *error_string;
                         OAF_GeneralError *error = OAF_GeneralError__alloc ();
 
-                        error_string = g_strdup_printf ("g_module_open of '%s' failed", filename);
+                        error_string = g_strdup_printf ("g_module_open of '%s' failed: %s", 
+                                                        filename, g_module_error ());
                         error->description = CORBA_string_dup (error_string);
                         CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
                                              ex_OAF_GeneralError, error);
Index: bonobo/monikers/bonobo-moniker-oaf.c
===================================================================
RCS file: /cvs/gnome/bonobo/monikers/bonobo-moniker-oaf.c,v
retrieving revision 1.8
diff -u -r1.8 bonobo-moniker-oaf.c
--- bonobo/monikers/bonobo-moniker-oaf.c	2001/05/02 19:26:28	1.8
+++ bonobo/monikers/bonobo-moniker-oaf.c	2001/08/09 23:34:00
@@ -10,6 +10,7 @@
 
 #include <liboaf/liboaf.h>
 #include <bonobo/bonobo-moniker-util.h>
+#include <bonobo/bonobo-exception.h>
 
 #include "bonobo-moniker-std.h"
 
@@ -39,6 +40,14 @@
 	object = oaf_activate_from_id (
 		(char *) bonobo_moniker_get_name_full (moniker), 0, NULL, ev);
 
+
+	if (BONOBO_USER_EX (ev, "IDL:OAF/GeneralError:1.0")) {
+		OAF_GeneralError *error;
+
+		error = ev->_params;
+		g_message ("OAF error activating component: %s", error->description);
+		return CORBA_OBJECT_NIL;
+	}
 /*	g_warning ("Activate from ID '%s' = '%p'", bonobo_moniker_get_name_full (moniker)); */
 
 	return bonobo_moniker_util_qi_return (object, requested_interface, ev);


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