MCPcopy
hub / github.com/triggerdotdev/trigger.dev / prettyError

Function prettyError

packages/cli-v3/src/utilities/cliOutput.ts:68–89  ·  view source on GitHub ↗
(header: string, body?: string, footer?: string)

Source from the content-addressed store, hash-verified

66}
67
68export function prettyError(header: string, body?: string, footer?: string) {
69 const prefix = "Error: ";
70 const indent = Array(prefix.length).fill(" ").join("");
71 const spacing = "\n\n";
72
73 const prettyPrefix = chalkError(prefix);
74
75 const withIndents = (text?: string) =>
76 text
77 ?.split("\n")
78 .map((line) => `${indent}${line}`)
79 .join("\n");
80
81 const prettyBody = withIndents(body);
82 const prettyFooter = withIndents(footer);
83
84 log.error(
85 `${prettyPrefix}${header}${prettyBody ? `${spacing}${prettyBody}` : ""}${
86 prettyFooter ? `${spacing}${prettyFooter}` : ""
87 }`
88 );
89}
90
91export function prettyWarning(header: string, body?: string, footer?: string) {
92 const prefix = "Warning: ";

Callers 1

loginFunction · 0.85

Calls 4

ArrayInterface · 0.85
chalkErrorFunction · 0.85
withIndentsFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…