Skip to content

Commit

Permalink
More helpful error message when a subregion is not found (#66)
Browse files Browse the repository at this point in the history
since people may be doing this in loops etc., it's better to present all available information.
  • Loading branch information
asinghvi17 authored Apr 17, 2024
1 parent 98a71fb commit 9a81c98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GADM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function get(country, subregions...; depth=0, kwargs...)

# filter layer by subregions
slayer = filterlayer(slayer, qkeys, qvalues)
isempty(slayer) && throw(ArgumentError("could not find required region"))
isempty(slayer) && throw(ArgumentError("could not find required region (country $country, subregions $subregions)"))

slayer
end
Expand Down

0 comments on commit 9a81c98

Please sign in to comment.