refactor(errors): put in constants

This commit is contained in:
moklick
2023-01-25 18:32:13 +01:00
parent 3b543cb015
commit 54010e7ee6
10 changed files with 43 additions and 27 deletions
@@ -10,6 +10,7 @@ import { GraphViewProps } from '../GraphView';
import { getPositionWithOrigin } from './utils';
import { Position } from '../../types';
import type { ReactFlowState, WrapNodeProps } from '../../types';
import { errorMessages } from '../../contants';
type NodeRendererProps = Pick<
GraphViewProps,
@@ -77,7 +78,7 @@ const NodeRenderer = (props: NodeRendererProps) => {
let nodeType = node.type || 'default';
if (!props.nodeTypes[nodeType]) {
onError?.('003', `Node type "${nodeType}" not found. Using fallback type "default".`);
onError?.('003', errorMessages['003'](nodeType));
nodeType = 'default';
}