diff --git a/assets/scripts/pages/resource-loader.js b/assets/scripts/pages/resource-loader.js index c53d21e..da1247e 100755 --- a/assets/scripts/pages/resource-loader.js +++ b/assets/scripts/pages/resource-loader.js @@ -107,10 +107,26 @@ els.syncStatus.querySelector("small").textContent = label; } + async function responseError(response, prefix) { + let detail = ""; + try { + const contentType = response.headers.get("Content-Type") || ""; + if (contentType.includes("application/json")) { + const body = await response.json(); + detail = body && body.message ? body.message : ""; + } else { + detail = (await response.text()).trim().slice(0, 240); + } + } catch (_) { + detail = ""; + } + return new Error(`${prefix} (${response.status})${detail ? `: ${detail}` : ""}`); + } + async function fetchServerLibrary() { const response = await fetch(API_URL, { cache: "no-store", credentials: "same-origin" }); if (response.status === 404) return null; - if (!response.ok) throw new Error(`Server library request failed (${response.status}).`); + if (!response.ok) throw await responseError(response, "Server library request failed"); const library = Model.normaliseLibrary(await response.json()); state.serverEtag = response.headers.get("ETag"); return library; @@ -128,7 +144,7 @@ headers: { "Content-Type": attachment.type || attachment.blob.type || "image/jpeg" }, body: attachment.blob, }); - if (!response.ok) throw new Error(`Thumbnail upload failed (${response.status}).`); + if (!response.ok) throw await responseError(response, "Thumbnail upload failed"); await deleteAttachment(id); state.uploadedThumbnails.add(id); })); @@ -153,10 +169,13 @@ toast("Changes from another device were merged."); return pushServerLibrary(merged, false); } - if (!response.ok) throw new Error(`Server save failed (${response.status}).`); + if (!response.ok) throw await responseError(response, "Server save failed"); state.serverEtag = response.headers.get("ETag"); - await uploadLocalThumbnails(library); setSyncStatus("synced", "synced to server"); + uploadLocalThumbnails(library).catch((error) => { + console.warn("Resource Loader metadata was saved, but a cover could not be uploaded.", error); + toast(`Saved to the server. Cover upload pending: ${error.message}`, true); + }); } async function saveLibrary() { diff --git a/build-logs/gitea-build-monitor.log b/build-logs/gitea-build-monitor.log index 5e8c50b..d98ba85 100755 --- a/build-logs/gitea-build-monitor.log +++ b/build-logs/gitea-build-monitor.log @@ -950,3 +950,34 @@ at , /home/zaine/master-folder/org-platform/org_web/build-logs/gite 2026-08-20T14:04:37.8512952+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. 2026-08-20T14:04:37.9343738+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 2026-08-20T14:04:38.2713260+01:00 [INFO] Sent authoring server test notification. +2026-08-20T14:19:48.5993450+01:00 [INFO] Prepared current build status for zaine/org_web: severity=Info, status=success +2026-08-20T14:19:48.6075666+01:00 [INFO] Fetching recent Gitea Actions runs for zaine/org_web. +2026-08-20T14:19:48.9599662+01:00 [ERROR] Failed to analyze job 843: Cannot bind argument to parameter 'LogText' because it is an empty string. +2026-08-20T14:19:49.5771097+01:00 [INFO] Sent build status notification with 1 embed(s). +2026-08-20T14:19:49.5967349+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. +2026-08-20T14:19:49.6733567+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 +2026-08-20T14:19:50.0076424+01:00 [INFO] Sent authoring server test notification. +2026-08-21T01:02:06.4972365+01:00 [INFO] Prepared current build status for zaine/org_web: severity=Info, status=success +2026-08-21T01:02:06.5049603+01:00 [INFO] Fetching recent Gitea Actions runs for zaine/org_web. +2026-08-21T01:02:07.3866825+01:00 [INFO] Sent build status notification with 1 embed(s). +2026-08-21T01:02:07.4073855+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. +2026-08-21T01:02:07.4841692+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 +2026-08-21T01:02:07.8213892+01:00 [INFO] Sent authoring server test notification. +2026-08-22T01:01:52.0344584+01:00 [INFO] Prepared current build status for zaine/org_web: severity=Info, status=success +2026-08-22T01:01:52.0428976+01:00 [INFO] Fetching recent Gitea Actions runs for zaine/org_web. +2026-08-22T01:01:52.8781493+01:00 [INFO] Sent build status notification with 1 embed(s). +2026-08-22T01:01:52.8986448+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. +2026-08-22T01:01:52.9796594+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 +2026-08-22T01:01:53.2844353+01:00 [INFO] Sent authoring server test notification. +2026-08-23T01:01:52.1862499+01:00 [INFO] Prepared current build status for zaine/org_web: severity=Info, status=success +2026-08-23T01:01:52.1951840+01:00 [INFO] Fetching recent Gitea Actions runs for zaine/org_web. +2026-08-23T01:01:53.0998809+01:00 [INFO] Sent build status notification with 1 embed(s). +2026-08-23T01:01:53.1220654+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. +2026-08-23T01:01:53.2055694+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 +2026-08-23T01:01:53.5671307+01:00 [INFO] Sent authoring server test notification. +2026-08-24T01:02:06.5023388+01:00 [INFO] Prepared current build status for zaine/org_web: severity=Info, status=success +2026-08-24T01:02:06.5112487+01:00 [INFO] Fetching recent Gitea Actions runs for zaine/org_web. +2026-08-24T01:02:07.5862361+01:00 [INFO] Sent build status notification with 1 embed(s). +2026-08-24T01:02:07.6056472+01:00 [INFO] Running authoring server tests with /home/zaine/master-folder/org-platform/authoring-service/.venv/bin/python. +2026-08-24T01:02:07.6978396+01:00 [INFO] Authoring server tests passed: ran=0, failures=0, errors=0, skipped=0, exit=0 +2026-08-24T01:02:08.0418080+01:00 [INFO] Sent authoring server test notification. diff --git a/posts/posts-list.org b/posts/posts-list.org index 4e3891a..f41dbdc 100755 --- a/posts/posts-list.org +++ b/posts/posts-list.org @@ -4,7 +4,7 @@ See the categories: @@html:Categories@@ * Posts: -- [[file:career/career-list.org][Career List]] @@html:20-08-2026 14:04@@ +- [[file:career/career-list.org][Career List]] @@html:24-08-2026 10:11@@ - [[file:career/cross-site-scripting-xss.org][Cross-Site Scripting (XSS)]] @@html:01-06-2026 10:21@@ @@html:@@ @@html:@@ - [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:11-03-2026 17:18@@ @@html:@@ @@html:@@ - [[file:career/javascript.org][Understands the Javascript language]] @@html:11-03-2026 16:52@@ @@html:@@ @@html:@@ diff --git a/rl/index.org b/rl/index.org index 374015f..99eb72d 100755 --- a/rl/index.org +++ b/rl/index.org @@ -4,6 +4,7 @@ #+DATE: <2026-08-19 Wed> #+BEGIN_EXPORT html +
diff --git a/sitemap.org b/sitemap.org index 2adffa3..65241c6 100755 --- a/sitemap.org +++ b/sitemap.org @@ -78,19 +78,19 @@ flowchart TD n30 --> n36 n37["Tag: website"] n30 --> n37 - n38["Tag: life"] + n38["Tag: update"] n30 --> n38 - n39["Tag: education"] + n39["Tag: life"] n30 --> n39 - n40["Tag: update"] + n40["Tag: education"] n30 --> n40 n41["Tag: insights"] n30 --> n41 n42["Tag: emacs"] n30 --> n42 - n43["Tag: maths"] + n43["Tag: reading"] n30 --> n43 - n44["Tag: reading"] + n44["Tag: maths"] n30 --> n44 n45{{"posts"}} root --> n45 @@ -211,13 +211,13 @@ flowchart TD click n35 "tags/notes.html" "Tag: notes" click n36 "tags/review.html" "Tag: review" click n37 "tags/website.html" "Tag: website" - click n38 "tags/life.html" "Tag: life" - click n39 "tags/education.html" "Tag: education" - click n40 "tags/update.html" "Tag: update" + click n38 "tags/update.html" "Tag: update" + click n39 "tags/life.html" "Tag: life" + click n40 "tags/education.html" "Tag: education" click n41 "tags/insights.html" "Tag: insights" click n42 "tags/emacs.html" "Tag: emacs" - click n43 "tags/maths.html" "Tag: maths" - click n44 "tags/reading.html" "Tag: reading" + click n43 "tags/reading.html" "Tag: reading" + click n44 "tags/maths.html" "Tag: maths" click n46 "posts/posts-intro.html" "Posts Introduction" click n47 "posts/posts-list.html" "Posts List" click n49 "posts/career/solid-principles.html" "SOLID Principles" @@ -301,13 +301,13 @@ flowchart TD - [[file:tags/notes.org][Tag: notes]] - [[file:tags/review.org][Tag: review]] - [[file:tags/website.org][Tag: website]] + - [[file:tags/update.org][Tag: update]] - [[file:tags/life.org][Tag: life]] - [[file:tags/education.org][Tag: education]] - - [[file:tags/update.org][Tag: update]] - [[file:tags/insights.org][Tag: insights]] - [[file:tags/emacs.org][Tag: emacs]] - - [[file:tags/maths.org][Tag: maths]] - [[file:tags/reading.org][Tag: reading]] + - [[file:tags/maths.org][Tag: maths]] - posts - [[file:posts/posts-intro.org][Posts Introduction]] - [[file:posts/posts-list.org][Posts List]]