R

Ravina • 3.96K Points
Extraordinary

Q. How can you provide custom exception handling in FastAPI?

  • (A) By overriding `handle_exception()`
  • (B) By using Flask errorhandler
  • (C) By using `@app.exception_handler()`
  • (D) By setting `raise_on_error=True`
  • Correct Answer - Option(C)
  • Views: 31
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina

`@app.exception_handler()` allows you to define custom handlers for exceptions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.