Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Dec 5, 2024
1 parent c0aa386 commit 51fcd06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function Base.setindex!(ds::AbstractDataset,data::AbstractVariable,varname::Symb
return defVar(ds, varname, data)
end

function Base.keys(ds::AbstractDataset)
function Base.keys(ds::AbstractDataset)
return varnames(ds)
end

Expand Down Expand Up @@ -248,7 +248,7 @@ function Base.getindex(ds::Union{AbstractDataset,AbstractVariable},n::CFStdName)
if length(ncvars) == 1
return ncvars[1]
else
throw(KeyError("$(length(ncvars)) matches while searching for a variable with standard_name attribute equal to $(n.name)"))
throw(KeyError("variable with standard_name attribute equal to $(n.name) ($(length(ncvars)) matches)"))
end
end

Expand Down

0 comments on commit 51fcd06

Please sign in to comment.