1
0
Fork 0

- catch sg_exception instead of sg_io_exception

- use guiErrorMessage
This commit is contained in:
curt 2001-07-24 23:50:08 +00:00
parent 43cf7b07fd
commit ddbd85aa7b
3 changed files with 10 additions and 33 deletions

View 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);

View 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);

View 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.");