From 0c9354d5f403c286d121b183659b8dc2af6a4f35 Mon Sep 17 00:00:00 2001 From: Anurag Ekkati Date: Sat, 10 Jan 2026 16:59:04 -0800 Subject: [PATCH 1/2] fix: Expand the logging around AggregateError (#6664) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../notification-provider.js | 43 +++++++++++++++++-- .../test-notification-provider.js | 34 +++++++++++++++ 2 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 test/backend-test/notification-providers/test-notification-provider.js diff --git a/server/notification-providers/notification-provider.js b/server/notification-providers/notification-provider.js index ee04b8ee4..5360007d1 100644 --- a/server/notification-providers/notification-provider.js +++ b/server/notification-providers/notification-provider.js @@ -108,16 +108,51 @@ class NotificationProvider { * @throws {any} The error specified */ throwGeneralAxiosError(error) { - let msg = "Error: " + error + " "; + let msg = error && error.message ? error.message : String(error); - if (error.response && error.response.data) { + if (error && error.code) { + msg += ` (code=${error.code})`; + } + + if (error && error.response && error.response.status) { + msg += ` (HTTP ${error.response.status}${error.response.statusText ? " " + error.response.statusText : ""})`; + } + + if (error && error.response && error.response.data) { if (typeof error.response.data === "string") { - msg += error.response.data; + msg += " " + error.response.data; } else { - msg += JSON.stringify(error.response.data); + try { + msg += " " + JSON.stringify(error.response.data); + } catch (e) { + msg += " " + String(error.response.data); + } } } + // Expand AggregateError to show underlying causes + let agg = null; + if (error && error.name === "AggregateError" && Array.isArray(error.errors)) { + agg = error; + } else if (error && error.cause && error.cause.name === "AggregateError" && Array.isArray(error.cause.errors)) { + agg = error.cause; + } + + if (agg) { + let causes = agg.errors + .map((e) => { + let m = e && e.message ? e.message : String(e); + if (e && e.code) { + m += ` (code=${e.code})`; + } + return m; + }) + .join("; "); + msg += " - caused by: " + causes; + } else if (error && error.cause && error.cause.message) { + msg += " - cause: " + error.cause.message; + } + throw new Error(msg); } diff --git a/test/backend-test/notification-providers/test-notification-provider.js b/test/backend-test/notification-providers/test-notification-provider.js new file mode 100644 index 000000000..06ebab8e6 --- /dev/null +++ b/test/backend-test/notification-providers/test-notification-provider.js @@ -0,0 +1,34 @@ +const { describe, test } = require("node:test"); +const assert = require("node:assert"); + +const NotificationProvider = require("../../../server/notification-providers/notification-provider"); + +describe("NotificationProvider.throwGeneralAxiosError()", () => { + const provider = new NotificationProvider(); + + test("expands AggregateError causes", () => { + let err1 = new Error("connect ECONNREFUSED 127.0.0.1:443"); + err1.code = "ECONNREFUSED"; + let err2 = new Error("connect ECONNREFUSED ::1:443"); + err2.code = "ECONNREFUSED"; + + let aggErr = new AggregateError([err1, err2], "AggregateError"); + + assert.throws(() => provider.throwGeneralAxiosError(aggErr), { + message: /^AggregateError - caused by: .+/, + }); + }); + + test("expands AggregateError wrapped in error.cause", () => { + let innerErr = new Error("connect ETIMEDOUT 10.0.0.1:443"); + innerErr.code = "ETIMEDOUT"; + + let aggErr = new AggregateError([innerErr], "AggregateError"); + let outerErr = new Error("Request failed"); + outerErr.cause = aggErr; + + assert.throws(() => provider.throwGeneralAxiosError(outerErr), { + message: /^Request failed - caused by: .+/, + }); + }); +}); From e90b982687fc6e10e073888d3c470a04415d25c4 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sun, 11 Jan 2026 05:05:43 +0100 Subject: [PATCH 2/2] chore: add a comment on first time contributors PRs instead of bloating the PR template (#6672) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 19 +++++------- .github/workflows/new_contributor_pr.yml | 38 ++++++++++++++++++++++++ README.md | 4 +-- 3 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/new_contributor_pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c617f99a9..5aac1e29d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,36 +1,31 @@ -ℹ️ To keep reviews fast and effective, please make sure you’ve [read our pull request guidelines](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma) +# Summary -## πŸ“ Summary of changes done and why they are done +In this pull request, the following changes are made: - - -## πŸ“‹ Related issues +- Foobar was changed to FooFoo, because ... - Relates to #issue-number - Resolves #issue-number -## πŸ“„ Checklist -
Please follow this checklist to avoid unnecessary back and forth (click to expand) - [ ] ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out - [ ] 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content. I understand that I am responsible for and able to explain every line of code I submit. -- [ ] πŸ” My code adheres to the style guidelines of this project. -- [ ] ⚠️ My changes generate no new warnings. -- [ ] πŸ› οΈ I have reviewed and tested my code. +- [ ] πŸ” Any UI changes adhere to visual style of this project. +- [ ] πŸ› οΈ I have self-reviewed and self-tested my code to ensure it works as expected. - [ ] πŸ“ I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods). - [ ] πŸ€– I added or updated automated tests where appropriate. - [ ] πŸ“„ Documentation updates are included (if applicable). -- [ ] πŸ”’ I have considered potential security impacts and mitigated risks. - [ ] 🧰 Dependency updates are listed and explained. +- [ ] ⚠️ CI passes and is green.
-## πŸ“· Screenshots or Visual Changes +## Screenshots for Visual Changes