@@ -550,18 +550,19 @@ public Type toFEELType(TDefinitions model, QualifiedName typeRef) {
550550 private Type toFEELTypeNoCache (TDefinitions model , QualifiedName typeRef ) {
551551 // Lookup item definitions
552552 if (model != null ) {
553- TItemDefinition itemDefinition = this .dmnModelRepository .lookupItemDefinition (model , typeRef );
554- if (itemDefinition != null ) {
555- return toFEELType (itemDefinition );
556- }
553+ TItemDefinition itemDefinition = this .dmnModelRepository .lookupItemDefinition (model , typeRef );
554+ if (itemDefinition != null ) {
555+ return toFEELType (itemDefinition );
556+ }
557557 }
558558
559559 // Lookup primitive types
560560 Type primitiveType = lookupPrimitiveType (typeRef );
561561 if (primitiveType != null ) {
562562 return primitiveType ;
563563 }
564- throw new SemanticError (String .format ("Cannot map type '%s' to FEEL" , typeRef ));
564+
565+ throw new SemanticError (ErrorFactory .makeDMNErrorMessage (model , null , String .format ("Cannot map type '%s' to FEEL" , typeRef )));
565566 }
566567
567568 @ Override
@@ -821,7 +822,7 @@ private Environment makeEnvironmentNoCache(TDRGElement element) {
821822
822823 return elementEnvironment ;
823824 } catch (Exception e ) {
824- throw new SemanticError (ErrorFactory .makeDMNErrorMessage (definitions , element , e . getMessage () ), e );
825+ throw new SemanticError (ErrorFactory .makeDMNErrorMessage (definitions , element , "Cannot create environment due to semantic errors" ), e );
825826 }
826827 }
827828
0 commit comments