diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 1b301b8d8..5419fcd04 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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); } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index e4f36c5c6..efdaf3020 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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); }