chore(warnings): add error codes to documentation site
This commit is contained in:
@@ -39,9 +39,7 @@ export function useMarkerSymbol(type: MarkerType) {
|
|||||||
const symbolExists = MarkerSymbols.hasOwnProperty(type);
|
const symbolExists = MarkerSymbols.hasOwnProperty(type);
|
||||||
|
|
||||||
if (!symbolExists) {
|
if (!symbolExists) {
|
||||||
console.warn(
|
console.warn(`[React Flow]: Marker type "${type}" doesn't exist. Help: https://reactflow.dev/error-decoder#900`);
|
||||||
`[React Flow]: marker type "${type}" doesn't exist. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
|
||||||
);
|
|
||||||
return () => null;
|
return () => null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,14 +107,14 @@ const EdgeRenderer = (props: EdgeRendererProps) => {
|
|||||||
|
|
||||||
if (!sourceHandle) {
|
if (!sourceHandle) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[React Flow]: couldn't create edge for source handle id: ${edge.sourceHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
`[React Flow]: Couldn't create edge for source handle id: ${edge.sourceHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/error-decoder#800`
|
||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetHandle) {
|
if (!targetHandle) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[React Flow]: couldn't create edge for target handle id: ${edge.targetHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
`[React Flow]: Couldn't create edge for target handle id: ${edge.targetHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/error-decoder#800`
|
||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const NodeRenderer = (props: NodeRendererProps) => {
|
|||||||
|
|
||||||
if (!props.nodeTypes[nodeType]) {
|
if (!props.nodeTypes[nodeType]) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[React Flow]: Node type "${nodeType}" not found. Using fallback type "default". Help: https://reactflow.dev/docs/guides/troubleshooting`
|
`[React Flow]: Node type "${nodeType}" not found. Using fallback type "default". Help: https://reactflow.dev/error-decoder#300`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function useNodeOrEdgeTypes(nodeOrEdgeTypes: any, createTypes: any): any
|
|||||||
const typeKeys = Object.keys(nodeOrEdgeTypes);
|
const typeKeys = Object.keys(nodeOrEdgeTypes);
|
||||||
if (shallow(typesKeysRef.current, typeKeys)) {
|
if (shallow(typesKeysRef.current, typeKeys)) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"[React Flow]: It looks like you have created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them. Help: https://reactflow.dev/docs/guides/troubleshooting"
|
"[React Flow]: It looks like you have created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them. Help: https://reactflow.dev/error-decoder#200"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function useResizeHandler(rendererNode: MutableRefObject<HTMLDivElement | null>)
|
|||||||
|
|
||||||
if (size.height === 0 || size.width === 0) {
|
if (size.height === 0 || size.width === 0) {
|
||||||
console.warn(
|
console.warn(
|
||||||
'[React Flow]: The React Flow parent container needs a width and a height to render the graph. Help: https://reactflow.dev/docs/guides/troubleshooting'
|
'[React Flow]: The React Flow parent container needs a width and a height to render the graph. Help: https://reactflow.dev/error-decoder#400'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -142,7 +142,7 @@ export function createPositionChange({
|
|||||||
: currentExtent;
|
: currentExtent;
|
||||||
} else {
|
} else {
|
||||||
console.warn(
|
console.warn(
|
||||||
'[React Flow]: Only child nodes can use a parent extent. Help: https://reactflow.dev/docs/guides/troubleshooting'
|
'[React Flow]: Only child nodes can use a parent extent. Help: https://reactflow.dev/error-decoder#500'
|
||||||
);
|
);
|
||||||
currentExtent = nodeExtent;
|
currentExtent = nodeExtent;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -58,7 +58,7 @@ const connectionExists = (edge: Edge, edges: Edge[]) => {
|
|||||||
export const addEdge = (edgeParams: Edge | Connection, edges: Edge[]): Edge[] => {
|
export const addEdge = (edgeParams: Edge | Connection, edges: Edge[]): Edge[] => {
|
||||||
if (!edgeParams.source || !edgeParams.target) {
|
if (!edgeParams.source || !edgeParams.target) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"[React Flow]: Can't create edge. An edge needs a source and a target. Help: https://reactflow.dev/docs/guides/troubleshooting"
|
"[React Flow]: Can't create edge. An edge needs a source and a target. Help: https://reactflow.dev/error-decoder#600"
|
||||||
);
|
);
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ export const addEdge = (edgeParams: Edge | Connection, edges: Edge[]): Edge[] =>
|
|||||||
export const updateEdge = (oldEdge: Edge, newConnection: Connection, edges: Edge[]): Edge[] => {
|
export const updateEdge = (oldEdge: Edge, newConnection: Connection, edges: Edge[]): Edge[] => {
|
||||||
if (!newConnection.source || !newConnection.target) {
|
if (!newConnection.source || !newConnection.target) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"[React Flow]: Can't create a new edge. An edge needs a source and a target. Help: https://reactflow.dev/docs/guides/troubleshooting"
|
"[React Flow]: Can't create a new edge. An edge needs a source and a target. Help: https://reactflow.dev/error-decoder#600"
|
||||||
);
|
);
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ export const updateEdge = (oldEdge: Edge, newConnection: Connection, edges: Edge
|
|||||||
|
|
||||||
if (!foundEdge) {
|
if (!foundEdge) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[React Flow]: The old edge with id=${oldEdge.id} does not exist. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
`[React Flow]: The old edge with id=${oldEdge.id} does not exist. Help: https://reactflow.dev/error-decoder#700`
|
||||||
);
|
);
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user