MCPcopy
hub / github.com/openclaw/clawsweeper / ghErrorText

Function ghErrorText

src/repair/github-cli.ts:232–247  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

230}
231
232export function ghErrorText(error: unknown): string {
233 if (!error || typeof error !== "object") return String(error ?? "");
234 const commandError = error as {
235 message?: string;
236 output?: unknown[];
237 stderr?: Buffer | string;
238 stdout?: Buffer | string;
239 };
240 const parts = [
241 commandError.stderr,
242 commandError.stdout,
243 ...(Array.isArray(commandError.output) ? commandError.output : []),
244 commandError.message,
245 ].filter(Boolean);
246 return stripAnsi(parts.map((part) => bufferLikeToString(part)).join("\n")).trim();
247}
248
249export function ghStdoutFromError(error: unknown): string {
250 if (!error || typeof error !== "object") return "";

Callers 15

shouldRetryGhFunction · 0.70
readReportFunction · 0.70
ensureLabelFunction · 0.70
activeRepairSourceJobsFunction · 0.70
liveRunRecordsFunction · 0.70
readRepoVariablesFunction · 0.70
fetchIssueCommentFunction · 0.70
isGitHubNotFoundErrorFunction · 0.70
compactGhErrorFunction · 0.70

Calls 2

bufferLikeToStringFunction · 0.85
stripAnsiFunction · 0.70

Tested by

no test coverage detected