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



commit 720ad1e707389cb26161da94114b0e4f726fe9ec
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 |    5 ++++-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7b8fe9b..ac22f4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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-09  Murray Cumming  <murrayc murrayc com>
 
 	test_document_autosave: Change the temp filename to avoid a clash.
diff --git a/glom/application.cc b/glom/application.cc
index 4d5b11c..7ea38de 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1215,7 +1215,10 @@ bool Application::on_document_load()
         }
         else if(!test)
         {
-          std::cerr << "Application::on_document_load(): unexpected error." << std::endl;
+          //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]