import sqlite3 import app print(f"DB PATH is: {app.DB_PATH}") conn = sqlite3.connect(app.DB_PATH) conn.row_factory = sqlite3.Row c = conn.cursor() c.execute("SELECT id, url, status, mode, error FROM jobs WHERE status='failed' ORDER BY id DESC LIMIT 5") rows = c.fetchall() for r in rows: print(f"--- JOB {r['id']} ({r['mode']}) ---") print(f"URL: {r['url']}") print(f"ERROR: {r['error']}") print("")