mirror of
https://github.com/wizarrrr/wizarr.git
synced 2026-07-31 15:27:35 -04:00
- 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>
22 lines
542 B
Python
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
|