You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(#159): correct behaviour when index's item or collection is missing from store
* fix(#159): support async tests
* fix(#159): test UriNotFoundException handling in core.py
* fix(#159): search handler tests
"Collection {collection_id} exists in the index but does not exist in the data store, index is outdated".format(
69
+
collection_id=collection_id
70
+
)
71
+
)
72
+
raiseNotFoundError(
73
+
"Collection {collection_id} not found in the indexed data store at {uri}. This means the index is outdated, and suggests this collection has been removed by the data store and may disappear at the next index update.".format(
74
+
collection_id=collection_id,
75
+
uri=e.uri,
76
+
)
77
+
)
78
+
raiseNotFoundError(
79
+
"Collection {collection_id} does not exist.".format(
80
+
collection_id=collection_id
63
81
)
64
-
raiseNotFoundError(f"Collection {collection_id} does not exist.")
82
+
)
65
83
66
84
asyncdefitem_collection(
67
85
self,
@@ -106,16 +124,31 @@ async def get_item(
106
124
[collection_id, item_id],
107
125
)
108
126
ifrowisnotNone:
109
-
returnfix_item_links(
110
-
Item(
111
-
StacParser(row[1].split(",")).parse_stac_item(
112
-
awaitfetch_dict(row[0])
113
-
)[1]
114
-
),
115
-
request,
116
-
)
127
+
try:
128
+
returnfix_item_links(
129
+
Item(
130
+
StacParser(row[1].split(",")).parse_stac_item(
131
+
awaitfetch_dict(row[0])
132
+
)[1]
133
+
),
134
+
request,
135
+
)
136
+
exceptUriNotFoundExceptionase:
137
+
_logger.warning(
138
+
"Item {collection_id}/{item_id} exists in the index but does not exist in the data store, index is outdated".format(
139
+
collection_id=collection_id, item_id=item_id
140
+
)
141
+
)
142
+
raiseNotFoundError(
143
+
"Item {item_id} not found in the indexed data store at {uri}. This means the index is outdated, and suggests this item has been removed by the data store and may disappear at the next index update.".format(
144
+
item_id=item_id,
145
+
uri=e.uri,
146
+
)
147
+
)
117
148
raiseNotFoundError(
118
-
f"Item {item_id} in Collection {collection_id} does not exist."
149
+
"Item {item_id} in Collection {collection_id} does not exist.".format(
0 commit comments