Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove throw from gdaljl_errorhandler #153

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ checking code decides it should throw.
function gdaljl_errorhandler(class::CPLErr, errno::Cint, errmsg::Cstring)
# function signature needs to match the one in __init__, and the signature
# of the callback for a custom error handler in the GDAL docs
if class === CE_Failure
throw(GDALError(class, errno, unsafe_string(errmsg)))
end
# return C_NULL to suppress any error printing by gdal
return C_NULL
end

"Check the last error type and throw a GDALError if it is a failure"
function maybe_throw()
if cplgetlasterrortype() === CE_Failure
if cplgetlasterrortype() >= CE_Failure
throw(GDALError())
end
nothing
Expand Down