MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / toLoadError

Function toLoadError

integrations/raycast/src/lib/zen.ts:186–204  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

184}
185
186export function toLoadError(err: unknown): LoadError {
187 if (err instanceof ZenCliNotFoundError || isMissingExecutableError(err)) {
188 return {
189 title: "ZenNotes CLI not found",
190 message:
191 "Install the zn command from ZenNotes Settings -> CLI, then run `zn list` in Terminal to verify it.",
192 };
193 }
194
195 const stderr =
196 isRecord(err) && typeof err.stderr === "string" ? err.stderr.trim() : "";
197 const message =
198 stderr.replace(/^(?:zn|zen):\s*/i, "") ||
199 (err instanceof Error ? err.message : String(err));
200 return {
201 title: "Could not load notes",
202 message,
203 };
204}
205
206export function cliSetupCopyActionContent(): string {
207 return "Open ZenNotes -> Settings -> CLI, install the zn command, then run `zn list` in Terminal to verify it.";

Callers 3

SearchNotesFunction · 0.90
updateNoteArchiveStateFunction · 0.90
moveNoteToTrashFunction · 0.90

Calls 2

isMissingExecutableErrorFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected