refactor(core): Include native Python option in Code node (#18331)

This commit is contained in:
Iván Ovejero
2025-08-18 12:25:47 +02:00
committed by GitHub
parent adaa1180eb
commit 47cb4a07ca
6 changed files with 146 additions and 48 deletions

View File

@@ -0,0 +1,15 @@
import { ApplicationError } from 'n8n-workflow';
import { isWrappableError, WrappedExecutionError } from './errors/WrappedExecutionError';
export function throwExecutionError(error: unknown): never {
if (error instanceof Error) {
throw error;
} else if (isWrappableError(error)) {
// The error coming from task runner is not an instance of error,
// so we need to wrap it in an error instance.
throw new WrappedExecutionError(error);
}
throw new ApplicationError(`Unknown error: ${JSON.stringify(error)}`);
}