Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Error Handling for HTTP API #13

Open
2 tasks
farhoud opened this issue Jul 31, 2024 · 0 comments
Open
2 tasks

Implement Error Handling for HTTP API #13

farhoud opened this issue Jul 31, 2024 · 0 comments
Assignees
Labels

Comments

@farhoud
Copy link
Contributor

farhoud commented Jul 31, 2024

Title: Implement Error Handling for Index and Search Endpoints

Description:
Handle common errors for the HTTP API endpoints to ensure robust and user-friendly responses.

Acceptance Criteria:

  • Return a 400 Bad Request error for missing required fields.
  • Return a 404 Not Found error for no matching search results.
  • Return a 500 Internal Server Error for unexpected server errors.

Response Examples:

  • 400 Bad Request:
    {
      "status": "error",
      "message": "Missing required fields."
    }
  • 404 Not Found:
    {
      "status": "error",
      "message": "No matching results found."
    }
  • 500 Internal Server Error:
    {
      "status": "error",
      "message": "An unexpected error occurred. Please try again later."
    }

Tasks:

  • Implement error handling for the /index endpoint.
  • Implement error handling for the /search endpoint.
@farhoud farhoud self-assigned this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant