Skip to content

Commit

Permalink
ES | returning real exception
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jul 31, 2023
1 parent eb87ab9 commit d932549
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def _get_resource_facets(self, facet_class, filters=None):
try:
facets = search.execute().facets
except TransportError as ex: # pragma: no cover
raise Http400(detail='Data too large.') from ex
raise Http400(detail=get(ex, 'error') or str(ex)) from ex

return facets

Expand Down
2 changes: 1 addition & 1 deletion core/common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def __get_queryset_from_search_results(self, search_results):
' or fine tune your query to get more accurate results.') from ex
raise ex
except TransportError as ex: # pragma: no cover
raise Http400(detail='Data too large.') from ex
raise Http400(detail=get(ex, 'error') or str(ex)) from ex

def get_search_results_qs(self):
return self.__get_queryset_from_search_results(self.__search_results)
Expand Down

0 comments on commit d932549

Please sign in to comment.