Missing failure checks in HDF5

Issue #820 new
Jan Blechta created an issue

There is around one hundred checks of the type dolfin_assert(foo != HDF5_FAIL). That's not fair for users having asserts off not to be caught on an error condition.

I remind that asserts are exclusively for checking consistency in our library, i.e. a condition which should always be true. They should not be used for checking correctness of user input or error conditions which can happen.

Comments (7)

  1. Chris Richardson

    We need a shorter one-line dolfin_error to avoid cluttering the code with error checks. Agree otherwise.

  2. Prof Garth Wells

    It's often not important where an error is raised, e.g. if trying to open a file that doesn't exist the most helpful message is a short one that says the file does not exist.

  3. Log in to comment