Skip to content

Commit

Permalink
error message
Browse files Browse the repository at this point in the history
  • Loading branch information
vedina committed Sep 19, 2024
1 parent 219979d commit b4b0734
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rcapi/services/solr_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async def solr_query_post(solr_url,query_params = None,post_param = None, token
response.raise_for_status() # Check for HTTP errors
return response
except httpx.HTTPStatusError as e:
raise HTTPException(status_code=e.response.status_code, detail="Error fetching data from external service")
raise HTTPException(status_code=e.response.status_code,
detail="Error fetching data from external service {}".format(e.response.text))

async def solr_query_get(solr_url,params = None, token = None):
async with httpx.AsyncClient() as client:
Expand All @@ -40,7 +41,8 @@ async def solr_query_get(solr_url,params = None, token = None):
response.raise_for_status() # Check for HTTP errors
return response
except httpx.HTTPStatusError as e:
raise HTTPException(status_code=e.response.status_code, detail="Error fetching data from external service")
raise HTTPException(status_code=e.response.status_code,
detail="Error fetching data from external service {}".format(e.response.text))

def solr_escape(value: str) -> str:
# Escape special characters that Solr expects to be escaped
Expand Down

0 comments on commit b4b0734

Please sign in to comment.