abort and HTTP Error Codes
Stop a request with a proper status.
Stopping a Request Early
Sometimes a view should stop right away, like when an item is missing. Flask gives you abort to bail out with the correct HTTP error.
Import abort
You bring it in straight from Flask. Then a single call ends the request and skips the rest of your view code.
from flask import abortAll lessons in this course
- abort and HTTP Error Codes
- Register errorhandler Functions
- Raise Custom Exception Classes
- Uniform JSON Error Envelopes