Skip to content

Commit

Permalink
Fix code scanning alert no. 41: Information exposure through an excep…
Browse files Browse the repository at this point in the history
…tion

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1dac837 commit 178266e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions End_to_end_Solutions/AOAISearchDemo/app/data/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def get_user_profile(user_id: str):
else:
return Response(response=json.dumps(user_profile.to_item()), status=200)
except Exception as e:
return Response(response=str(e), status=500)
logger.exception(f"get-user-profile: error: {e}")
return Response(response="An internal server error occurred.", status=500)

@app.route('/user-profiles', methods=['GET'])
def get_all_user_profiles():
Expand All @@ -214,7 +215,8 @@ def get_all_user_profiles():
json_user_profiles = [user_profile.to_item() for user_profile in user_profiles]
return Response(response=json.dumps(json_user_profiles), status=200)
except Exception as e:
return Response(response=str(e), status=500)
logger.exception(f"get-all-user-profiles: error: {e}")
return Response(response="An internal server error occurred.", status=500)

@app.route('/user-groups/<group_id>', methods=['POST'])
def create_user_group(group_id: str):
Expand Down

0 comments on commit 178266e

Please sign in to comment.