From eb1c6adbc7e5f526b2df7357ff96cc93c0f7a166 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Wed, 28 Sep 2016 01:32:47 +0200 Subject: [PATCH] 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. --- src/Navaids/fixlist.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Navaids/fixlist.cxx b/src/Navaids/fixlist.cxx index 2cc02d463..d8e03bf56 100644 --- a/src/Navaids/fixlist.cxx +++ b/src/Navaids/fixlist.cxx @@ -66,9 +66,11 @@ void FixesLoader::loadFixes(const SGPath& path) const std::string utf8path = path.utf8Str(); 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 for (int i = 0; i < 2; i++) { in >> skipeol;