Add controller logging and return readable errors

The controller ran silently and surfaced errors as opaque/empty bodies,
making it impossible to diagnose failures from either the UI or the server.
- Configure Python logging (timestamps, levels) and log job lifecycle events
  (created / dispatched / done / failed) plus startup and dispatch warnings.
- Add a catch-all error handler so unhandled exceptions return a JSON error
  with the exception type+message instead of an empty response.
- Remove the frontend submit bug that hand-set multipart Content-Type without
  a boundary (and built an opts object it never used); post the FormData
  directly so the browser sets the correct content type + boundary.
This commit is contained in:
Brett Williams
2026-08-30 22:39:16 -05:00
parent 6f38beaf92
commit 8a6f02b7e9
3 changed files with 31 additions and 2 deletions
-2
View File
@@ -176,8 +176,6 @@ $("#job-form").addEventListener("submit", async (e) => {
body.append("file", file);
}
try {
const opts = { method: "POST", body };
if (!git) opts.headers = { "Content-Type": "multipart/form-data" }; // let browser set boundary
const res = await fetch("/api/jobs", { method: "POST", body });
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.error || res.statusText);