From c6711fb8776a6f47bd9bd04a0b4e3f816dc1c01f Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 24 Jul 2001 23:51:36 +0000 Subject: [PATCH] - catch sg_exception instead of sg_io_exception - use new sg_throwable::getFormattedMessage method --- src/Main/fg_init.cxx | 6 ++---- src/Main/options.cxx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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); }