refactor(core): Improve UX on permission errors (no-changelog) (#13795)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-03-11 17:52:33 +01:00
committed by GitHub
parent a12935d724
commit ca9e62bdc0
17 changed files with 298 additions and 134 deletions

View File

@@ -1,14 +1,9 @@
import { Container } from '@n8n/di';
import type {
IDataObject,
INode,
INodeCredentialsDetails,
IRun,
ITaskData,
NodeApiError,
WorkflowExecuteMode,
WorkflowOperationError,
NodeOperationError,
IWorkflowBase,
} from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
@@ -16,53 +11,6 @@ import { v4 as uuid } from 'uuid';
import { CredentialsRepository } from '@/databases/repositories/credentials.repository';
import { VariablesService } from '@/environments.ee/variables/variables.service.ee';
export function generateFailedExecutionFromError(
mode: WorkflowExecuteMode,
error: NodeApiError | NodeOperationError | WorkflowOperationError,
node: INode,
): IRun {
return {
data: {
startData: {
destinationNode: node.name,
runNodeFilter: [node.name],
},
resultData: {
error,
runData: {
[node.name]: [
{
startTime: 0,
executionTime: 0,
error,
source: [],
},
],
},
lastNodeExecuted: node.name,
},
executionData: {
contextData: {},
metadata: {},
nodeExecutionStack: [
{
node,
data: {},
source: null,
},
],
waitingExecution: {},
waitingExecutionSource: {},
},
},
finished: false,
mode,
startedAt: new Date(),
stoppedAt: new Date(),
status: 'error',
};
}
/**
* Returns the data of the last executed node
*/