NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdfgroup] netcdf c++ interface does not propagate errors in NcFile constructor

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 fail

but when the NcFile constructor finishes, the destructor of NcError is called, which will reset the NcError.


Heiko




  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: