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