- catch sg_exception instead of sg_io_exception
- use guiErrorMessage
This commit is contained in:
parent
43cf7b07fd
commit
ddbd85aa7b
3 changed files with 10 additions and 33 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.");
|
||||
|
|
Loading…
Reference in a new issue