Unidata/netcdf-cxx4 — pull request #9 by jarlela (2013-12-16 19:11:56+00:00)
Title: Exception hierarchy

The exception classes does not propagate all availabel error information from the netcdf-c api (e.g. returned system error codes are lost). This can easily be improved by including the netcdf-c return value as an error code. As a consequence the NcException constructor signatures must be modified.

Secondly, the netcdf-c api already includes a function to retreive an error message. Using nc_strerror in ncCheck ensures a consistent error message. This will also let any change/addition in the error codes of the netcdf-c api be reflected the NcException automatically.

Finally, in my opinion the hierarchy of exception classes seems a bit excessive. I think that structure in many cases will lead to many unnecessary catch blocks. I suggest that only a single exception class is used, but I suppose this is a bit of a discussion point. As long as the error code is included in NcException the user may choose to simply ignore the derived classes in any case.