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 8ebef2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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
16 changes: 8 additions & 8 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 Expand Up @@ -2892,7 +2892,7 @@ function h5p_get_buffer(plist_id, tconv, bkg)
finally
unlock(liblock)
end
@h5error "Error in h5p_get_buffer (not annotated)"
#@h5error "Error in h5p_get_buffer (not annotated)"
return var"#status#"
end

Expand Down Expand Up @@ -7150,7 +7150,7 @@ function h5t_get_ebias(dtype_id)
finally
unlock(liblock)
end
@h5error "Error getting exponent bias"
#@h5error "Error getting exponent bias"
return var"#status#"
end

Expand Down Expand Up @@ -7214,7 +7214,7 @@ function h5t_get_member_offset(dtype_id, index)
finally
unlock(liblock)
end
@h5error "Error getting offset of compound datatype #$(index)"
#@h5error "Error getting offset of compound datatype #$(index)"
return var"#status#"
end

Expand Down Expand Up @@ -7310,7 +7310,7 @@ function h5t_get_precision(dtype_id)
finally
unlock(liblock)
end
@h5error "Error getting precision"
#@h5error "Error getting precision"
return var"#status#"
end

Expand Down Expand Up @@ -7342,7 +7342,7 @@ function h5t_get_size(dtype_id)
finally
unlock(liblock)
end
@h5error "Error getting type size"
#@h5error "Error getting type size"
return var"#status#"
end

Expand Down

0 comments on commit 8ebef2e

Please sign in to comment.