Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/server/src/agents/pin-write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
validatePinValue,
type PinType,
} from "../pins.js";
import { errorMessage } from "../shared/lib/error-message.js";
import { AgentError } from "./errors.js";
import { finalizePin, mergePin, type DraftPin } from "./pin-merge.js";
import type { AgentPin } from "./types.js";
Expand Down Expand Up @@ -48,10 +49,7 @@ function validateStoredPin(pin: DraftPin): AgentPin {
validatePinValue(stored.type, stored.value);
if (stored.type === "shortcut") validatePinShortcutFields(stored);
} catch (error) {
throw new AgentError(
error instanceof Error ? error.message : String(error),
400
);
throw new AgentError(errorMessage(error), 400);
}
return stored;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/shared/mcp/whiteboard-tools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import * as z from "zod/v4";

import { errorMessage } from "../lib/error-message.js";
import { jsonText } from "./response.js";
import { toToolError } from "./tool-error.js";
import type {
Expand Down Expand Up @@ -335,7 +336,7 @@ export function registerWhiteboardTools(
// caller that guessed at the element shape gets told where it lives.
return toToolError(
new Error(
`${error instanceof Error ? error.message : String(error)} — call whiteboard_howto for the element format.`
`${errorMessage(error)} — call whiteboard_howto for the element format.`
)
);
}
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/shared/plugin-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { readFile } from "node:fs/promises";
import { isPluginAgentType, PLUGIN_AGENT_TYPES } from "./agent-types.js";
import type { PluginAgentType } from "./agent-types.js";
import { compareSemver } from "./lib/compare-semver.js";
import { errorMessage } from "./lib/error-message.js";
import { runCommand, type CommandRunner } from "./lib/run-command.js";

export { isPluginAgentType, PLUGIN_AGENT_TYPES };
Expand Down Expand Up @@ -121,7 +122,7 @@ async function runStep(
const result = await run(bin, args, { timeoutMs });
return { stdout: result.stdout };
} catch (err) {
return { error: err instanceof Error ? err.message : String(err) };
return { error: errorMessage(err) };
}
}

Expand Down
Loading