Skip to content

Commit

Permalink
Merge pull request #31 from arpitjain099/alert-autofix-28
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 28: Information exposure through an exception
  • Loading branch information
arpitjain099 authored Oct 20, 2024
2 parents 26a0d0f + f40c656 commit 98b4f8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions End_to_end_Solutions/AOAISearchDemo/app/data/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def create_chat_session(user_id: str, conversation_id: str):
return Response(response=json.dumps(session.to_item()), status=201)
except (TypeError, NullValueError, MissingPropertyError) as e:
logger.exception(f"create-chat-session: error: {e} ", extra=properties)
return Response(response="Invalid input provided.", status=400)
return Response(response="A bad request error occurred.", status=400)
except CosmosConflictError as e:
logger.exception(f"create-chat-session: error: {e} ", extra=properties)
return Response(response="Conflict occurred while creating chat session.", status=409)
except Exception as e:
logger.exception(f"create-chat-session: error: {e} ", extra=properties)
return Response(response="An internal error has occurred.", status=500)
return Response(response="An internal server error occurred.", status=500)

@app.route('/chat-sessions/<user_id>/<conversation_id>', methods=['GET'])
def get_chat_session(user_id: str, conversation_id: str):
Expand All @@ -92,7 +92,7 @@ def get_chat_session(user_id: str, conversation_id: str):
return Response(response=json.dumps(session.to_item()), status=200)
except Exception as e:
logger.exception(f"get-chat-session: error: {e} ", extra=properties)
return Response(response="An internal error has occurred.", status=500)
return Response(response="An internal server error occurred.", status=500)

@app.route('/check-chat-session/<user_id>/<conversation_id>', methods=['GET'])
def check_chat_session(user_id: str, conversation_id: str):
Expand Down

0 comments on commit 98b4f8e

Please sign in to comment.