if ( path.length() ) {
SGPath config = globals->resolve_aircraft_path(path);
-
+#if defined(ENABLE_DEV_WARNINGS)
// load an obsolete xml configuration
SG_LOG( SG_SYSTEMS, SG_WARN,
"Reading deprecated xml electrical system model from\n "
<< config.str() );
+#endif
try {
- readProperties( config.str(), config_props );
+ readProperties( config, config_props );
if ( build(config_props) ) {
enabled = true;
} else {
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "Detected a logic error in the electrical system ");
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "specification file. See earlier errors for " );
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "details.");
- exit(-1);
+ throw sg_exception("Logic error in electrical system file.");
}
} catch (const sg_exception&) {
SG_LOG( SG_SYSTEMS, SG_ALERT,
"Failed to load electrical system model: "
- << config.str() );
+ << config );
}
} else {
SG_LOG( SG_SYSTEMS, SG_INFO,