mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Enrich inaccessible credential error (#8574)
Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Service } from 'typedi';
|
||||
import type { INode, Workflow } from 'n8n-workflow';
|
||||
import { NodeOperationError, WorkflowOperationError } from 'n8n-workflow';
|
||||
import { CredentialAccessError, NodeOperationError, WorkflowOperationError } from 'n8n-workflow';
|
||||
|
||||
import config from '@/config';
|
||||
import { License } from '@/License';
|
||||
@@ -59,13 +59,10 @@ export class PermissionChecker {
|
||||
if (inaccessibleCredIds.length === 0) return;
|
||||
|
||||
// if disallowed, flag only first node using first inaccessible cred
|
||||
const inaccessibleCredId = inaccessibleCredIds[0];
|
||||
const nodeToFlag = credIdsToNodes[inaccessibleCredId][0];
|
||||
|
||||
const nodeToFlag = credIdsToNodes[inaccessibleCredIds[0]][0];
|
||||
|
||||
throw new NodeOperationError(nodeToFlag, 'Node has no access to credential', {
|
||||
description: 'Please recreate the credential or ask its owner to share it with you.',
|
||||
level: 'warning',
|
||||
});
|
||||
throw new CredentialAccessError(nodeToFlag, inaccessibleCredId, workflow);
|
||||
}
|
||||
|
||||
async checkSubworkflowExecutePolicy(
|
||||
|
||||
Reference in New Issue
Block a user