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:
parent
29c7fa54b1
commit
eb1c6adbc7
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue