if ( !in.is_open() ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << aptdb_file );
- exit(-1);
+ throw sg_io_exception("cannot open APT file", aptdb_file);
}
string line;
} else {
SG_LOG( SG_GENERAL, SG_ALERT,
"Unknown line(#" << line_num << ") in apt.dat file: " << line );
- exit( -1 );
+ throw sg_format_exception("malformed line in apt.dat:", line);
}
}
const string& rwy_no_1(token[8]);
const string& rwy_no_2(token[17]);
- if ( rwy_no_1.size() == 0 || rwy_no_2.size() == 0 )
+ if ( rwy_no_1.empty() || rwy_no_2.empty() )
return;
double displ_thresh1 = atof( token[11].c_str() );