Nextcloud: Netzfehler mit Ursache melden (0.44.4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -65,3 +65,14 @@ describe("vCard", () => {
|
||||
expect(fingerabdruck({ name: "A B" })).toBe(fingerabdruck({ name: "A B", firma: null }));
|
||||
});
|
||||
});
|
||||
|
||||
describe("Netzfehler mit Ursache", () => {
|
||||
it("zeigt code und message aus err.cause", async () => {
|
||||
const { abrufMitUrsache, fehlerText } = await import("../src/server/nextcloud.js");
|
||||
const tls = Object.assign(new Error("unable to verify the first certificate"), { code: "UNABLE_TO_VERIFY_LEAF_SIGNATURE" });
|
||||
const fehler = new TypeError("fetch failed", { cause: tls });
|
||||
expect(fehlerText(fehler)).toBe("fetch failed – UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate");
|
||||
const abruf = (async () => { throw fehler; }) as unknown as typeof fetch;
|
||||
await expect(abrufMitUrsache(abruf, "https://cloud.test/remote.php/dav", {})).rejects.toThrow("cloud.test nicht erreichbar: fetch failed – UNABLE_TO_VERIFY_LEAF_SIGNATURE");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user