[glom/glom-1-18] Glade utils: Catch generic exceptions.



commit 1299d08c11147c490d3ee636b9cdda20b4604c4a
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Sep 29 09:27:15 2011 +0200

    Glade utils: Catch generic exceptions.
    
    * glom/glade_utils.h: Though this only happens when gtkmm has not been
    initialized.

 ChangeLog          |    7 +++++++
 glom/glade_utils.h |   10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0111edb..77b238e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-29  Murray Cumming  <murrayc murrayc com>
+
+	Glade utils: Catch generic exceptions.
+
+	* glom/glade_utils.h: Though this only happens when gtkmm has not been 
+	initialized.
+
 2011-10-06  Ben Konrath  <ben bagu org>
 
 	Fix small bugs in commented-out debugging print statements.
diff --git a/glom/glade_utils.h b/glom/glade_utils.h
index ebf6f62..ff8d32e 100644
--- a/glom/glade_utils.h
+++ b/glom/glade_utils.h
@@ -69,15 +69,19 @@ void helper_get_glade_widget_derived_with_warning(const std::string& filename, c
   }
   catch(const Gtk::BuilderError& ex)
   {
-    std::cerr << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
   }
   catch(const Glib::MarkupError& ex)
   {
-    std::cerr << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
   }
   catch(const Glib::FileError& ex)
   {
-    std::cerr << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
+  }
+  catch(const Glib::Error& ex)
+  {
+    std::cerr << G_STRFUNC << ": Exception of unexpected type: " << ex.what() << std::endl;
   }
 #else
   std::auto_ptr<Glib::Error> error;



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