Skip to content

Inconsistent error messages between get_profile and delete_profile #16

@anxkhn

Description

@anxkhn

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

  1. Request a non-existent profile:

    curl http://localhost:8000/profile/nobody

    Response: {"detail": "Profile not found"}

  2. 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

  • Both endpoints use the same error message (e.g., "Profile not found")
  • All existing tests still pass

Suggested approach

  1. Open app/main.py.
  2. Find delete_profile and change detail="User not found" to detail="Profile not found".
  3. Run pytest tests/ -v.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions