Skip to content

Commit 2f958ee

Browse files
check if JSON document has mandatory id element (issue #22)
1 parent a5b22d4 commit 2f958ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/catalog.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ item = subcat1.items["LC08_L1TP_152038_20200611_20200611_01_RT"]
112112
"""
113113
function Catalog(url::String; parent = nothing)
114114
data = cached_resolve(url)
115+
116+
if !haskey(data,:id)
117+
throw(ArgumentError("The mandatory STAC id element is missing in $url"))
118+
end
119+
115120
assets = _assets(data)
116121

117122
return Catalog(url,data,parent,assets)

0 commit comments

Comments
 (0)