Context
When a profile is not found, the get_profile endpoint returns the message "Profile not found" but the delete_profile endpoint returns "User not found". Error messages should be consistent across the API for the same type of error.
Steps to reproduce
-
Request a non-existent profile:
curl http://localhost:8000/profile/nobody
Response: {"detail": "Profile not found"}
-
Delete a non-existent profile:
curl -X DELETE http://localhost:8000/profile/nobody
Response: {"detail": "User not found"}
Expected behavior
Both endpoints should use the same error message for a missing profile, e.g., "Profile not found".
Actual behavior
GET /profile/{username} returns "Profile not found"
DELETE /profile/{username} returns "User not found"
Files
app/main.py -- both get_profile and delete_profile functions, specifically the HTTPException detail strings
Acceptance criteria
Suggested approach
- Open
app/main.py.
- Find
delete_profile and change detail="User not found" to detail="Profile not found".
- Run
pytest tests/ -v.
Context
When a profile is not found, the
get_profileendpoint returns the message"Profile not found"but thedelete_profileendpoint returns"User not found". Error messages should be consistent across the API for the same type of error.Steps to reproduce
Request a non-existent profile:
Response:
{"detail": "Profile not found"}Delete a non-existent profile:
Response:
{"detail": "User not found"}Expected behavior
Both endpoints should use the same error message for a missing profile, e.g.,
"Profile not found".Actual behavior
GET /profile/{username}returns"Profile not found"DELETE /profile/{username}returns"User not found"Files
app/main.py-- bothget_profileanddelete_profilefunctions, specifically theHTTPExceptiondetail stringsAcceptance criteria
"Profile not found")Suggested approach
app/main.py.delete_profileand changedetail="User not found"todetail="Profile not found".pytest tests/ -v.