1
0
Fork 0

fix.dat parser: correct use of sg_io_exception

- For sg_io_exception's constructor, 'location' is not the same as
  'origin'.
- Use simgear::strutils::error_string() to provide details on the error.
This commit is contained in:
Florent Rougon 2016-09-28 01:32:47 +02:00
parent 29c7fa54b1
commit eb1c6adbc7

View file

@ -66,7 +66,9 @@ void FixesLoader::loadFixes(const SGPath& path)
const std::string utf8path = path.utf8Str(); const std::string utf8path = path.utf8Str();
if ( !in.is_open() ) { if ( !in.is_open() ) {
throw sg_io_exception("Cannot open file:", path); throw sg_io_exception(
"Cannot open file (" + simgear::strutils::error_string(errno) + ")",
sg_location(path));
} }
// toss the first two lines of the file // toss the first two lines of the file