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 { addEdge } from '../../utils/graph';
import { Position } from '../../types';
import type { HandleProps, Connection, ReactFlowState } from '../../types';
import { isValidHandle } from './utils';
import { errorMessages } from '../../contants';
const alwaysValid = () => true;
@@ -42,9 +43,7 @@ const Handle = forwardRef<HTMLDivElement, HandleComponentProps>(
const nodeId = useNodeId();
if (!nodeId) {
store
.getState()
.onError?.('010', 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.');
store.getState().onError?.('010', errorMessages['010']());
return null;
}