- catch sg_exception instead of sg_io_exception
- use new sg_throwable::getFormattedMessage method
This commit is contained in:
parent
ffd94e24a1
commit
c6711fb877
2 changed files with 4 additions and 8 deletions
|
@ -219,11 +219,9 @@ bool fgInitConfig ( int argc, char **argv ) {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
|
SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
|
||||||
try {
|
try {
|
||||||
readProperties(props_path.str(), globals->get_props());
|
readProperties(props_path.str(), globals->get_props());
|
||||||
} catch (const sg_io_exception &e) {
|
} catch (const sg_exception &e) {
|
||||||
string message = "Error reading global preferences: ";
|
string message = "Error reading global preferences: ";
|
||||||
message += e.getMessage();
|
message += e.getFormattedMessage();
|
||||||
message += "\n at ";
|
|
||||||
message += e.getLocation().asString();
|
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, message);
|
SG_LOG(SG_INPUT, SG_ALERT, message);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -883,11 +883,9 @@ parse_option (const string& arg)
|
||||||
string file = arg.substr(9);
|
string file = arg.substr(9);
|
||||||
try {
|
try {
|
||||||
readProperties(file, globals->get_props());
|
readProperties(file, globals->get_props());
|
||||||
} catch (const sg_io_exception &e) {
|
} catch (const sg_exception &e) {
|
||||||
string message = "Error loading config file: ";
|
string message = "Error loading config file: ";
|
||||||
message += e.getMessage();
|
message += e.getFormattedMessage();
|
||||||
message += "\n at ";
|
|
||||||
message += e.getLocation().asString();
|
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, message);
|
SG_LOG(SG_INPUT, SG_ALERT, message);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue