mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2026-09-07 21:41:09 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ button:hover { filter: brightness(1.1); }
|
||||
.badge.queued, .badge.dispatching, .badge.building { background: #1c2a40; color: var(--accent); }
|
||||
.badge.cancelled { background: var(--panel-2); color: var(--muted); }
|
||||
|
||||
.modal[hidden] { display: none; }
|
||||
.modal {
|
||||
position: fixed; inset: 0;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
|
||||
Reference in New Issue
Block a user