(error: unknown)
| 228 | * Normalizes terminal error data before it is stored. |
| 229 | */ |
| 230 | export function normalizeConsoleError(error: unknown): string | null | undefined { |
| 231 | if (error === undefined) { |
| 232 | return undefined |
| 233 | } |
| 234 | |
| 235 | if (error === null) { |
| 236 | return null |
| 237 | } |
| 238 | |
| 239 | return truncateString( |
| 240 | typeof error === 'string' ? error : safeConsoleStringify(normalizeConsoleValue(error)) |
| 241 | ) |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * Returns a workflow's entries trimmed to the configured cap. |
no test coverage detected