feat(core): add vue flow error class

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-05 23:55:27 +01:00
committed by Braks
parent 1448543993
commit dc60e112a1
6 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export default function useEdge<Data = ElementData, CustomEvents extends Record<
const edge = findEdge<Data, CustomEvents>(edgeId)
if (!edge) {
throw new Error(`[vue-flow]: useEdge - Edge with id ${edgeId} not found!`)
throw new VueFlowError(`Edge with id ${edgeId} not found!`, 'useEdge')
}
return {
+1 -1
View File
@@ -16,7 +16,7 @@ export default function useNode<Data = ElementData, CustomEvents extends Record<
const node = findNode<Data, CustomEvents>(nodeId)
if (!node) {
throw new Error(`[vue-flow]: useNode - Node with id ${nodeId} not found!`)
throw new VueFlowError(`Node with id ${nodeId} not found!`, 'useNode')
}
return {
+1 -1
View File
@@ -126,7 +126,7 @@ export default (options?: FlowProps): VueFlowStore => {
/**
* Vue flow wasn't able to find any store instance - we can't proceed
*/
if (!vueFlow) throw new Error('[vueflow]: store instance not found.')
if (!vueFlow) throw new VueFlowError('Store instance not found.', 'useVueFlow')
// always provide a fresh instance into context on call
if (scope) {