( text: string, code: number, path: string[] = [], source: string | null = null, )
| 146 | } |
| 147 | |
| 148 | function 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 | } |
no test coverage detected
searching dependent graphs…