Skip to content

Commit

Permalink
Provide error message if component not found
Browse files Browse the repository at this point in the history
Change-Id: I59009ca0fde4360694244acb328b49cb47fe29d4
  • Loading branch information
BenediktSeidl committed Aug 14, 2024
1 parent 7633af6 commit d1649c7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ const components: Record<Components['type'], unknown> = {
}
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}`)
}
</script>

Expand Down

0 comments on commit d1649c7

Please sign in to comment.