]> git.mxchange.org Git - flightgear.git/commitdiff
- catch sg_exception instead of sg_io_exception
authorcurt <curt>
Tue, 24 Jul 2001 23:50:08 +0000 (23:50 +0000)
committercurt <curt>
Tue, 24 Jul 2001 23:50:08 +0000 (23:50 +0000)
- use guiErrorMessage

src/Cockpit/hud.cxx
src/Cockpit/panel_io.cxx
src/Main/fg_commands.cxx

index fcc1ea9306c87f29de5a02d8dfb598ff7589e1a0..c4f8d2c50ec60a34c58ee16b4f62bcfb71b28150 100644 (file)
@@ -648,13 +648,8 @@ int readHud( istream &input )
 
     try {
       readProperties(input, &root);
-    } catch (const sg_io_exception &e) {
-      string message = "Error reading HUD: ";
-      message += e.getMessage();
-      message += "\n at ";
-      message += e.getLocation().asString();
-      SG_LOG(SG_INPUT, SG_ALERT, message);
-      mkDialog(message.c_str());
+    } catch (const sg_exception &e) {
+      guiErrorMessage("Error reading HUD: ", e);
       return 0;
     }
   
@@ -687,13 +682,8 @@ int readHud( istream &input )
         SGPropertyNode root2;
        try {
          readProperties(path.str(), &root2);
-       } catch (const sg_io_exception &e) {
-         string message = "Error reading HUD instrument: ";
-         message += e.getMessage();
-         message += "\n at ";
-         message += e.getLocation().asString();
-         SG_LOG(SG_INPUT, SG_ALERT, message);
-         mkDialog(message.c_str());
+       } catch (const sg_exception &e) {
+         guiErrorMessage("Error reading HUD instrument: ", e);
          continue;
        }
        readInstrument(&root2);
index 456d2d82ff6b41a9b7c7bc2a1ace92a6cb9f2ac4..5d86f1248f81789bc8b5c9d21f1b278a7ee9809a 100644 (file)
@@ -765,12 +765,8 @@ fgReadPanel (istream &input)
 
   try {
     readProperties(input, &root);
-  } catch (const sg_io_exception &e) {
-    string message = e.getMessage();
-    message += "\n at ";
-    message += e.getLocation().asString();
-    SG_LOG(SG_INPUT, SG_ALERT, message);
-    mkDialog(message.c_str());
+  } catch (const sg_exception &e) {
+    guiErrorMessage("Error reading panel: ", e);
     return 0;
   }
   return readPanel(&root);
@@ -792,12 +788,8 @@ fgReadPanel (const string &relative_path)
 
   try {
     readProperties(path.str(), &root);
-  } catch (const sg_io_exception &e) {
-    string message = e.getMessage();
-    message += "\n at ";
-    message += e.getLocation().asString();
-    SG_LOG(SG_INPUT, SG_ALERT, message);
-    mkDialog(message.c_str());
+  } catch (const sg_exception &e) {
+    guiErrorMessage("Error reading panel: ", e);
     return 0;
   }
   return readPanel(&root);
index de48e81e8b79e3bc124dd3b575478893990f62dc..75d2725dc2b0c09715cc2dac4c754125d1d9917f 100644 (file)
@@ -212,13 +212,8 @@ do_preferences_load (const SGPropertyNode * arg, SGCommandState ** state)
         << props_path.str());
   try {
     readProperties(props_path.str(), globals->get_props());
-  } catch (const sg_io_exception &e) {
-    string message = "Error reading global preferences: ";
-    message += e.getMessage();
-    message += "\n at ";
-    message += e.getLocation().asString();
-    SG_LOG(SG_INPUT, SG_ALERT, message);
-    mkDialog(message.c_str());
+  } catch (const sg_exception &e) {
+    guiErrorMessage("Error reading global preferences: ", e);
     return false;
   }
   SG_LOG(SG_INPUT, SG_INFO, "Successfully read global preferences.");