Hello,

I'm doing my first steps with the C++ API, and there's one problem I can't 
conquer:

I'm trying to test if a dataset exists using the following code:

        try{
            std::cout << "Trying to open DS..." << endl;
            H5::DataSet foo = fg_p->openDataSet(location);
        }

        catch(H5::GroupIException e) {
            std::cout << "GroupIException" << endl;
        }
        catch(H5::FileIException e) {
            std::cout << "FileIException" << endl;
        }
        catch (...) {
            std::cout << "Caught by ..." << endl;
            return false;
        }
        return true;

fg_p is a pointer to a CommonFG object, location is a string here.

For datasets that exist it works alright, but for a non-existing dataset, only
the catch(...) is triggered. What would be the correct exception to catch here?

Also is there a way to suppress all the HDF5-DIAG output that I get?

Thanks,
Daniel

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to