seed r178 - trunk/libseed



Author: racarr
Date: Sat Nov  8 01:21:32 2008
New Revision: 178
URL: http://svn.gnome.org/viewvc/seed?rev=178&view=rev

Log:
Throw exceptions for GErrors out of functions.


Modified:
   trunk/libseed/seed-engine.c

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Sat Nov  8 01:21:32 2008
@@ -268,9 +268,28 @@
 			    seed_gi_argument_make_js(&retval, type_info, exception);
 		g_base_info_unref((GIBaseInfo *) type_info);
 	} else {
-		g_error("Error invoking function, %s. %s \n",
-			g_base_info_get_name((GIBaseInfo *) info),
-			error->message);
+			GString * string = g_string_new(g_quark_to_string(error->domain));
+		int w;
+		
+		*(string->str) = g_unichar_toupper(*(string->str));
+		for (w = 0; w < string->len; w++)
+		{
+				if (*(string->str+w) == '-')
+				{
+						*(string->str+w+1) = 
+								g_unichar_toupper(*(string->str+w+1));
+						g_string_erase(string, w,1);
+				}
+				else if (!strcmp(string->str+w-1, "Quark"))
+						g_string_truncate(string, w-1);
+
+		}
+		seed_make_exception(exception, string->str,
+							error->message);
+		g_free(in_args);
+		g_free(out_args);
+		
+		return JSValueMakeNull(eng->context);
 	}
 
 	g_free(in_args);



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