mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2026-09-07 21:41:09 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user