[glom] Cope with Gnome::Gda::DataModelIter::get_value_at() throwing.



commit be537a50264a658594ef16d13c2147ae1ddf90d0
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 10 23:01:51 2011 +0200

    Cope with Gnome::Gda::DataModelIter::get_value_at() throwing.
    
    * glom/libglom/connectionpool_backends/postgres.cc: Add a catch/try
    around get_value_at(), because the latest version of libgdamm can
    throw an exception there.

 ChangeLog                                        |    8 ++++++++
 glom/libglom/connectionpool_backends/postgres.cc |   11 ++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index dfc4114..34f65e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-10-10  Murray Cumming  <murrayc murrayc com>
 
+	Cope with Gnome::Gda::DataModelIter::get_value_at() throwing.
+
+	* glom/libglom/connectionpool_backends/postgres.cc: Add a catch/try
+	around get_value_at(), because the latest version of libgdamm can 
+	throw an exception there.
+
+2011-10-10  Murray Cumming  <murrayc murrayc com>
+
 	Use gdk_window_get_device_position() instead of gdk_window_get_pointer().
 
 	* glom/mode_data/box_data_calendar_related.cc:
diff --git a/glom/libglom/connectionpool_backends/postgres.cc b/glom/libglom/connectionpool_backends/postgres.cc
index 6fa964c..4b63dae 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -397,7 +397,16 @@ bool Postgres::check_postgres_gda_client_is_available()
     {
       //See http://library.gnome.org/devel/libgda/unstable/libgda-40-Configuration.html#gda-config-list-providers
       //about the columns of this DataModel:
-      const Gnome::Gda::Value name = iter->get_value_at(0);
+      Gnome::Gda::Value name;
+      try
+      {
+        name = iter->get_value_at(0);
+      }
+      catch(const Glib::Error& ex)
+      {
+        std::cerr << G_STRFUNC << ": exception: " << ex.what() << std::endl;
+      }
+
       if(name.get_value_type() != G_TYPE_STRING)
         continue;
 



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