mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
refactor(core): Stop reporting to Sentry unrecognized node errors (no-changelog) (#7728)
https://n8nio.sentry.io/issues/4636584213
This commit is contained in:
parent
b4ebb1a28d
commit
0408299c7d
|
@ -390,7 +390,7 @@ describe('Canvas Node Manipulation and Navigation', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
WorkflowPage.actions.executeWorkflow();
|
WorkflowPage.actions.executeWorkflow();
|
||||||
cy.contains('Node not found').should('be.visible');
|
cy.contains('Unrecognized node type').should('be.visible');
|
||||||
|
|
||||||
WorkflowPage.getters
|
WorkflowPage.getters
|
||||||
.canvasNodeByName(`${unknownNodeName} 1`)
|
.canvasNodeByName(`${unknownNodeName} 1`)
|
||||||
|
@ -404,6 +404,6 @@ describe('Canvas Node Manipulation and Navigation', () => {
|
||||||
|
|
||||||
WorkflowPage.actions.executeWorkflow();
|
WorkflowPage.actions.executeWorkflow();
|
||||||
|
|
||||||
cy.contains('Node not found').should('not.exist');
|
cy.contains('Unrecognized node type').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,12 +8,19 @@ import type {
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { NodeHelpers } from 'n8n-workflow';
|
import { NodeHelpers } from 'n8n-workflow';
|
||||||
import { Service } from 'typedi';
|
import { Service } from 'typedi';
|
||||||
import { RESPONSE_ERROR_MESSAGES } from './constants';
|
|
||||||
import { LoadNodesAndCredentials } from './LoadNodesAndCredentials';
|
import { LoadNodesAndCredentials } from './LoadNodesAndCredentials';
|
||||||
import { join, dirname } from 'path';
|
import { join, dirname } from 'path';
|
||||||
import { readdir } from 'fs/promises';
|
import { readdir } from 'fs/promises';
|
||||||
import type { Dirent } from 'fs';
|
import type { Dirent } from 'fs';
|
||||||
|
|
||||||
|
class UnrecognizedNodeError extends Error {
|
||||||
|
severity = 'warning';
|
||||||
|
|
||||||
|
constructor(nodeType: string) {
|
||||||
|
super(`Unrecognized node type: ${nodeType}".`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class NodeTypes implements INodeTypes {
|
export class NodeTypes implements INodeTypes {
|
||||||
constructor(private loadNodesAndCredentials: LoadNodesAndCredentials) {
|
constructor(private loadNodesAndCredentials: LoadNodesAndCredentials) {
|
||||||
|
@ -67,7 +74,8 @@ export class NodeTypes implements INodeTypes {
|
||||||
loadedNodes[type] = { sourcePath, type: loaded };
|
loadedNodes[type] = { sourcePath, type: loaded };
|
||||||
return loadedNodes[type];
|
return loadedNodes[type];
|
||||||
}
|
}
|
||||||
throw new Error(`${RESPONSE_ERROR_MESSAGES.NO_NODE}: ${type}`);
|
|
||||||
|
throw new UnrecognizedNodeError(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getNodeTranslationPath({
|
async getNodeTranslationPath({
|
||||||
|
|
Loading…
Reference in a new issue