From d1649c7fd1224c3ddee114554896cc3a480d6145 Mon Sep 17 00:00:00 2001 From: Benedikt Seidl Date: Wed, 14 Aug 2024 13:19:56 +0200 Subject: [PATCH] Provide error message if component not found Change-Id: I59009ca0fde4360694244acb328b49cb47fe29d4 --- .../src/components/cmk-form/CmkFormDispatcher.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cmk-frontend-vue/src/components/cmk-form/CmkFormDispatcher.vue b/packages/cmk-frontend-vue/src/components/cmk-form/CmkFormDispatcher.vue index d410b6e9bd5..4b37efedad1 100644 --- a/packages/cmk-frontend-vue/src/components/cmk-form/CmkFormDispatcher.vue +++ b/packages/cmk-frontend-vue/src/components/cmk-form/CmkFormDispatcher.vue @@ -42,7 +42,11 @@ const components: Record = { } function getComponent(): IComponent { - return components[props.spec.type as Components['type']] as IComponent + const result = components[props.spec.type as Components['type']] + if (result !== undefined) { + return result as IComponent + } + throw new Error(`Could not find Component for type=${props.spec.type}`) }