Skip to content

Commit 03a9c76

Browse files
committed
clean up error messaging
1 parent 2e7073c commit 03a9c76

File tree

1 file changed

+3
-3
lines changed
  • stac_fastapi/elasticsearch/stac_fastapi/elasticsearch

1 file changed

+3
-3
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def all_collections(self, **kwargs) -> Collections:
5757
index="stac_collections", doc_type="_doc", query={"match_all": {}}
5858
)
5959
except elasticsearch.exceptions.NotFoundError:
60-
raise NotFoundError("No collections exist in the database yet")
60+
raise NotFoundError("No collections exist")
6161
serialized_collections = [
6262
self.collection_serializer.db_to_stac(
6363
collection["_source"], base_url=base_url
@@ -111,7 +111,7 @@ def item_collection(
111111
try:
112112
count = search.count()
113113
except elasticsearch.exceptions.NotFoundError:
114-
raise NotFoundError("No items exist for this collection yet")
114+
raise NotFoundError("No items exist")
115115
# search = search.sort({"id.keyword" : {"order" : "asc"}})
116116
search = search.query()[0:limit]
117117
collection_children = search.execute().to_dict()
@@ -325,7 +325,7 @@ def post_search(
325325
try:
326326
count = search.count()
327327
except elasticsearch.exceptions.NotFoundError:
328-
raise NotFoundError("No items have been added to the database yet")
328+
raise NotFoundError("No items exist")
329329

330330
# search = search.sort({"id.keyword" : {"order" : "asc"}})
331331
search = search.query()[0 : search_request.limit]

0 commit comments

Comments
 (0)