diff --git a/packages/discord/src/connector.mjs b/packages/discord/src/connector.mjs index a99a96794..74833e4c3 100644 --- a/packages/discord/src/connector.mjs +++ b/packages/discord/src/connector.mjs @@ -35,7 +35,7 @@ import { reloadDiff } from "./binding.mjs"; import { envelope, splitReply } from "./context.mjs"; import { ensureJournal, appendInbox, readInboxIds, appendOutbox, unresolvedOutbox, appendDrop, - writeTurn, appendAdmission, countAdmissionsOn, appendNotice, noticeOn, utcDate, stopRequested, + writeTurn, appendAdmission, countAdmissionsOn, appendNotice, noticeOn, utcDate, stopRequested, journalLabel, } from "./journal.mjs"; import { RestOutcome } from "./rest.mjs"; import { DiscordError } from "./errors.mjs"; @@ -596,7 +596,7 @@ ${status === "not-posted" ? APPROVAL_LINES.pressAgain : APPROVAL_LINES.failed}`; async start() { processing(); if (state.started) throw new DiscordError("connector already started", 1); - if (stopRequested(journalDir)) throw new DiscordError(`STOP is present in ${journalDir}; remove it to run`, 1); + if (stopRequested(journalDir)) throw new DiscordError(`STOP is present in ${journalLabel(journalDir)}; remove it to run`, 1); const reconciled = await reconcile(); const approvals = await reconcileApprovals(); processing(); diff --git a/packages/discord/tests/connector.test.mjs b/packages/discord/tests/connector.test.mjs index a12018c33..f8aab191d 100644 --- a/packages/discord/tests/connector.test.mjs +++ b/packages/discord/tests/connector.test.mjs @@ -230,7 +230,7 @@ test("restart: an inbox with three ids and a replay of the same three produces z test("stop: STOP present refuses start; STOP written while running refuses new turns and the current one finishes", async () => { const { journalDir, rest, engine, connector } = setup({ replies: [{ text: "done", delayMs: 30 }] }); requestStop(journalDir, "test"); - await assert.rejects(connector.start(), /STOP is present/); + await assert.rejects(connector.start(), (err) => /STOP is present/.test(err.message) && !err.message.includes(journalDir)); assert.equal(engine.started, false); writeFileSync(join(journalDir, "STOP"), ""); // still present; clear it const { unlinkSync } = await import("node:fs");