1
0
Fork 0

- catch sg_exception instead of sg_io_exception

- use new sg_throwable::getFormattedMessage method
This commit is contained in:
curt 2001-07-24 23:51:36 +00:00
parent ffd94e24a1
commit c6711fb877
2 changed files with 4 additions and 8 deletions

View file

@ -219,11 +219,9 @@ bool fgInitConfig ( int argc, char **argv ) {
SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
try {
readProperties(props_path.str(), globals->get_props());
} catch (const sg_io_exception &e) {
} catch (const sg_exception &e) {
string message = "Error reading global preferences: ";
message += e.getMessage();
message += "\n at ";
message += e.getLocation().asString();
message += e.getFormattedMessage();
SG_LOG(SG_INPUT, SG_ALERT, message);
exit(2);
}

View file

@ -883,11 +883,9 @@ parse_option (const string& arg)
string file = arg.substr(9);
try {
readProperties(file, globals->get_props());
} catch (const sg_io_exception &e) {
} catch (const sg_exception &e) {
string message = "Error loading config file: ";
message += e.getMessage();
message += "\n at ";
message += e.getLocation().asString();
message += e.getFormattedMessage();
SG_LOG(SG_INPUT, SG_ALERT, message);
exit(2);
}