R

Ravina • 3.96K Points
Extraordinary

Q. What happens if a route raises a `ValueError` and no handler is defined?

  • (A) FastAPI auto-converts it to 404
  • (B) FastAPI returns 500 Internal Server Error
  • (C) FastAPI returns 400 Bad Request
  • (D) FastAPI logs and ignores it
  • Correct Answer - Option(B)
  • Views: 31
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina

Unhandled exceptions like `ValueError` result in a 500 response.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.