MCPcopy
hub / github.com/angular/angular / formatErrorMessage

Function formatErrorMessage

packages/core/src/render3/errors_di.ts:148–162  ·  view source on GitHub ↗
(
  text: string,
  code: number,
  path: string[] = [],
  source: string | null = null,
)

Source from the content-addressed store, hash-verified

146}
147
148function formatErrorMessage(
149 text: string,
150 code: number,
151 path: string[] = [],
152 source: string | null = null,
153): string {
154 let pathDetails = '';
155 // If the path is empty or contains only one element (self) -
156 // do not append additional info the error message.
157 if (path && path.length > 1) {
158 pathDetails = ` Path: ${path.join(' -> ')}.`;
159 }
160 const sourceDetails = source ? ` Source: ${source}.` : '';
161 return formatRuntimeError(code, `${text}${sourceDetails}${pathDetails}`);
162}

Callers 1

augmentRuntimeErrorFunction · 0.85

Calls 2

formatRuntimeErrorFunction · 0.90
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…