Skip to content

Commit

Permalink
keep try/finally, always throw
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Sep 8, 2023
1 parent 8e33c0c commit 19bd547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/api/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ macro h5error(msg)
# functions, which would clear the error stack.
quote
err_id = h5e_get_current_stack()
if h5e_get_num(err_id) > 0
#if h5e_get_num(err_id) > 0
throw(H5Error($(esc(msg)), err_id))
else
h5e_close_stack(err_id)
end
#else
# h5e_close_stack(err_id)
#end
end
end

Expand Down
6 changes: 3 additions & 3 deletions src/api/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ See `libhdf5` documentation for [`H5Aiterate2`](https://docs.hdfgroup.org/hdf5/v
"""
function h5a_iterate(obj_id, idx_type, order, n, op, op_data)
lock(liblock)
var"#status#" = #try
var"#status#" = try
ccall((:H5Aiterate2, libhdf5), herr_t, (hid_t, Cint, Cint, Ptr{hsize_t}, Ptr{Cvoid}, Any), obj_id, idx_type, order, n, op, op_data)
#finally
finally
unlock(liblock)
#end
end
# @show var"#status#"
var"#status#" < herr_t(0) && @h5error(string("Error iterating attributes in object ", h5i_get_name(obj_id)))
return nothing
Expand Down

0 comments on commit 19bd547

Please sign in to comment.