- To: netcdf@xxxxxxxxxxxxxxxx
- Subject: [netcdfgroup] netcdf c++ interface does not propagate errors in NcFile constructor
- From: Heiko Klein <Heiko.Klein@xxxxxx>
- Date: Tue, 01 Mar 2011 16:36:13 +0100
Hi, when opening a netcdf-file with the (old) cpp interface of netcdf, e.g. new NcFile(filename, NcFile::ReadOnly) it is not possible to catch any error, e.g. "No such file or directory". The problem is that NcFile::NcFile internally sets NcError err(NcError::silent_nonfatal); // constructor must not failbut when the NcFile constructor finishes, the destructor of NcError is called, which will reset the NcError.
Heiko