Skip to content

Commit

Permalink
fix extension error function
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Aug 31, 2023
1 parent ce71ee5 commit 4729abf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/extensions.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# extensions
function throw_extension_error(package::String, extension::Symbol)
function throw_extension_error(f::Function, package::String, extension::Symbol, args)
@static if isdefined(Base, :get_extension) # julia > 1.9
if isnothing(Base.get_extension(Rasters, extension))
throw(BackendException(package))
else
throw(MethodError(resample, args))
throw(MethodError(f, args))
end
else
throw(BackendException(package))
Expand All @@ -13,9 +13,9 @@ end


# stubs that need ArchGDAL
resample(args...; kw...) = throw_extension_error("ArchGDAL", :RastersArchGDALExt)
warp(args...; kw...) = throw_extension_error("ArchGDAL", :RastersArchGDALExt)
cellsize(args...; kw...) = throw_extension_error("ArchGDAL", :RastersArchGDALExt)
resample(args...; kw...) = throw_extension_error(resample, "ArchGDAL", :RastersArchGDALExt, args)
warp(args...; kw...) = throw_extension_error(warp, "ArchGDAL", :RastersArchGDALExt, args)
cellsize(args...; kw...) = throw_extension_error(cellsize, "ArchGDAL", :RastersArchGDALExt, args)

# Other shared stubs
function layerkeys end
Expand Down

0 comments on commit 4729abf

Please sign in to comment.