[glom/feature_choices_show_all] Document loading: Show an error dialog even for unexpected errors.



commit accd90d911f2d931f7460fa67cf56c993087614d
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Aug 6 15:47:54 2010 +0200

    Document loading: Show an error dialog even for unexpected errors.
    
    * glom/application.cc: on_document_load(): Don't just fail silently when
      there is an unexpected error, for instance if the postgres data directory
      is missing.

 ChangeLog           |    8 ++++++++
 glom/application.cc |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 04cf9f3..1d0101f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-08-06  Murray Cumming  <murrayc murrayc com>
 
+	Document loading: Show an error dialog even for unexpected errors.
+
+	* glom/application.cc: on_document_load(): Don't just fail silently when
+  there is an unexpected error, for instance if the postgres data directory
+  is missing.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
 	Utils::get_choice_values(): Reduce copy/pasted code.
 
 	* glom/libglom/utils.[h|cc]: build_sql_select_with_key(): Add a sort_clause
diff --git a/glom/application.cc b/glom/application.cc
index ae656d4..b67f97c 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1217,6 +1217,9 @@ bool Application::on_document_load()
         }
         else if(!test)
         {
+          //std::cerr might show some hints, but we don't want to confront the user with them:
+          //TODO: Actually complain about specific stuff such as missing data, because the user might really play with the file system.
+          Frame_Glom::show_ok_dialog(_("Problem Loading Document"), _("Glom could not load the document."), *this, Gtk::MESSAGE_ERROR);
           std::cerr << G_STRFUNC << ": unexpected error." << std::endl;
         }
       }



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