Files
n8n/packages/@n8n/utils/src/errors/get-error-message.ts
T
60de10030b chore: Extract the duplicated getErrorMessage helper in the instance-ai module into @n8n/utils (#37724)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-03 10:23:13 +00:00

5 lines
207 B
TypeScript

/** Returns the message of `error`, or its string form if it is not an `Error`. */
export function getErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
}