Files
wizarr/app/error_handlers.py
Matthieu B 7b8f64af7d Fix SQLAlchemy model constructors to accept keyword arguments
- Added __init__ constructors to all SQLAlchemy models
- Fixed pyright 'No parameter named' errors across the codebase
- Fixed various ruff linting issues (SIM108, E741, E402, SIM102, B904, SIM105)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 13:52:15 +02:00

22 lines
542 B
Python

# app/error_handlers.py
import logging
from flask import render_template
def register_error_handlers(app):
@app.errorhandler(500)
def error_500(e):
logging.error("500: %s", e, exc_info=True)
return render_template("error/500.html"), 500
@app.errorhandler(404)
def error_404(e):
logging.info("404: %s", e)
return render_template("error/404.html"), 404
@app.errorhandler(401)
def error_401(e):
logging.info("401: %s", e)
return render_template("error/401.html"), 401