More detailed error message for missing files
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 29 Sep 2015 19:11:05 +0000 (22:11 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 5 Oct 2015 10:47:14 +0000 (12:47 +0200)
commit041719a20ccdc273703f718787841d386fbffe58
treeb5d153151c065bba87624605af73897e579a7389
parente863f054904fce8ba4082a086184388bd4ccf51b
More detailed error message for missing files

Make it possible to report the actual OS error from File::exists(),
and use this to provide more detailed error messages when a file
provided on the command line does not exist.

Make some unexpected I/O errors fatal instead of silently returning
false from the existence check (the caller can still decide to just get
false even in error conditions, which is used in some older code).

Provide context information for more exceptions that can be thrown
during command-line parsing (in particular, for the file I/O exceptions
that this code can generate, but also some other cases are improved).

Change-Id: Ie39858f4722221a7d98c41aad950c9ee7fde4bbd
14 files changed:
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/options/filenameoptionmanager.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/fileredirector.cpp
src/gromacs/utility/fileredirector.h
src/gromacs/utility/path.cpp
src/gromacs/utility/path.h
src/testutils/refdata.cpp
src/testutils/testfileredirector.cpp
src/testutils/testfileredirector.h