22 const H5E_error2_t* err_desc,
24 auto** e_iter =
static_cast<ExceptionType**
>(client_data);
26 const char* major_err = detail::nothrow::h5e_get_major(err_desc->maj_num);
27 const char* minor_err = detail::nothrow::h5e_get_minor(err_desc->min_num);
29 std::ostringstream oss;
30 oss <<
'(' << major_err <<
") " << minor_err;
32 detail::nothrow::h5_free_memory((
void*) major_err);
33 detail::nothrow::h5_free_memory((
void*) minor_err);
35 auto* e =
new ExceptionType(oss.str());
36 e->_err_major = err_desc->maj_num;
37 e->_err_minor = err_desc->min_num;
38 (*e_iter)->_next.reset(e);
44 [[noreturn]]
static inline void ToException(
const std::string& prefix_msg) {
45 hid_t err_stack = H5Eget_current_stack();
48 ExceptionType* e_iter = &e;
50 detail::nothrow::h5e_walk2(err_stack,
52 &HDF5ErrMapper::stackWalk<ExceptionType>,
54 detail::nothrow::h5e_clear2(err_stack);
56 const char* next_err_msg = (e.nextException() != NULL) ? (e.nextException()->what())
59 e.setErrorMsg(prefix_msg +
" " + next_err_msg);
63 throw ExceptionType(prefix_msg +
": Unknown HDF5 error");