diff --git a/src/fortran.cpp b/src/fortran.cpp index eff37da..285d100 100644 --- a/src/fortran.cpp +++ b/src/fortran.cpp @@ -8,18 +8,23 @@ using namespace std; using namespace CosmoTool; UnformattedRead::UnformattedRead(const string& fname) - throw() + throw(NoSuchFileException) { f = new ifstream(fname.c_str()); + if (!*f) + throw NoSuchFileException(); + swapOrdering = false; cSize = Check_32bits; checkPointRef = checkPointAccum = 0; } UnformattedRead::UnformattedRead(const char *fname) - throw() + throw(NoSuchFileException) { f = new ifstream(fname); + if (!*f) + throw NoSuchFileException(); swapOrdering = false; cSize = Check_32bits; checkPointRef = checkPointAccum = 0; diff --git a/src/fortran.hpp b/src/fortran.hpp index 21751bc..361978e 100644 --- a/src/fortran.hpp +++ b/src/fortran.hpp @@ -25,9 +25,9 @@ namespace CosmoTool }; UnformattedRead(const std::string& fname) - throw (); + throw (NoSuchFileException); UnformattedRead(const char *fname) - throw (); + throw (NoSuchFileException); ~UnformattedRead(); // Todo implement primitive description