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

Better errors for missing Dict keys #178

Closed
rafaqz opened this issue Apr 18, 2021 · 2 comments
Closed

Better errors for missing Dict keys #178

rafaqz opened this issue Apr 18, 2021 · 2 comments

Comments

@rafaqz
Copy link
Collaborator

rafaqz commented Apr 18, 2021

It's possible to get errors like this when you try to create a file with the wrong data type, and the _GDALTYPE Dict is accessed:

ERROR: KeyError: key Int64 not found
Stacktrace:
 [1] getindex at ./dict.jl:467 [inlined]
 [2] #unsafe_create#56 at /root/.julia/packages/ArchGDAL/j9NPL/src/dataset.jl:200 [inlined]
 [3] create(::GeoData.var"#190#191"{GeoArray{Int64,3,Tuple{Lon{LinRange{Float64},Projected{

It could be better to throw a more descriptive error, like "Int64 is not a recognised data type" etc. I'm not sure if this also applies to the other const Dicts in use like _JLType

See https://github.com/rafaqz/GeoData.jl/issues/143

@evetion
Copy link
Collaborator

evetion commented Apr 18, 2021

I have similar issues over at evetion/GeoArrays.jl#42, would be nice if we can solve it within ArchGDAL.

@yeesian
Copy link
Owner

yeesian commented Jun 24, 2021

Addressed by #179.

@yeesian yeesian closed this as completed Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants