Fix modal never dismissing and noisy 404 errors

The .modal CSS display:flex override the hidden attribute, so the empty job
modal was always visible on load and closeModal() could not hide it - the
'non-dismissable empty error'. Add .modal[hidden] { display:none } so the
hidden attribute wins.

The blanket errorhandler(Exception) also converted normal HTTP 404s (e.g.
/favicon.ico, /apple-touch-icon-*.png requested by the browser) into 500s,
flooding the log. Return HTTPException instances unchanged so only genuine
500s are logged as errors.
This commit is contained in:
Brett Williams
2026-08-30 22:41:59 -05:00
parent 8a6f02b7e9
commit 5967b606c7
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -5,6 +5,7 @@ import os
import queue
from flask import Flask, jsonify, request, send_from_directory, Response
from werkzeug.exceptions import HTTPException
import ctrl.db as db
import ctrl.settings as settings
@@ -150,6 +151,8 @@ def api_stream(job_id):
@app.errorhandler(Exception)
def _handle_error(err):
if isinstance(err, HTTPException):
return err
log.exception("Unhandled error serving %s %s", request.method, request.path)
return jsonify({"error": f"{type(err).__name__}: {err}"}), 500