When code hits an unexpected condition, it has to decide what to do. Each tab is a different way to get that decision wrong — fail open, fall back insecurely, or leak secrets to the user.
A debug error handler dumps the full Python traceback to the user. The traceback exposes the SQL query, file paths, framework versions, and any local variables.
try:
rows = execute(f"... WHERE username='{user}'")
except Exception:
return traceback.format_exc() # full stack trace to the user
Submit alice. No error.
Submit x'. SQL malforms; server replies with the whole traceback
including a local variable db_password.