From: bcoconni Date: Tue, 14 Jul 2015 13:59:45 +0000 (+0200) Subject: Clarified the error message: recall the name of the file that has not been found. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e9239c71781114abad232ece16fc72495148666c;p=flightgear.git Clarified the error message: recall the name of the file that has not been found. --- diff --git a/src/FDM/JSBSim/input_output/FGModelLoader.cpp b/src/FDM/JSBSim/input_output/FGModelLoader.cpp index 7c84dc7f9..45378efc4 100644 --- a/src/FDM/JSBSim/input_output/FGModelLoader.cpp +++ b/src/FDM/JSBSim/input_output/FGModelLoader.cpp @@ -46,7 +46,7 @@ using namespace std; namespace JSBSim { -IDENT(IdSrc, "$Id: FGModelLoader.cpp,v 1.1 2014/06/09 11:52:06 bcoconni Exp $"); +IDENT(IdSrc, "$Id: FGModelLoader.cpp,v 1.3 2015/07/12 12:41:55 bcoconni Exp $"); IDENT(IdHdr, ID_MODELLOADER); /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -64,10 +64,11 @@ Element_ptr FGModelLoader::Open(Element *el) try { file = model->FindFullPathName(fname); + if (file.empty()) throw string("File does not exist."); } catch(string& e) { cerr << endl << el->ReadFrom() - << "Could not open file: " << e << endl; + << "Could not open file: " << fname << endl << e << endl; return NULL; }