mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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:
committed by
GitHub
parent
a12935d724
commit
ca9e62bdc0
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user