Skip to content

Commit

Permalink
Improve GetDerivedInstances to log a message instead of throwing exce…
Browse files Browse the repository at this point in the history
…ption #651

- added anchor
  • Loading branch information
mpostol committed Mar 12, 2022
1 parent 9b6880a commit 3d76ee0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SemanticData/UANodeSetValidation/UANodeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void Update(UANode node, Action<UAReferenceContext> addReference)
case ReferenceKindEnum.Custom:
case ReferenceKindEnum.HasComponent:
case ReferenceKindEnum.HasProperty:
//NetworkIdentifier is missing in generated Model Design for DI model #629
case ReferenceKindEnum.HierarchicalReferences:
break;

case ReferenceKindEnum.HasModellingRule:
Expand Down Expand Up @@ -194,7 +196,7 @@ void IUANodeBase.CalculateNodeReferences(INodeFactory nodeFactory, IValidator va
case ReferenceKindEnum.HierarchicalReferences:
//TODO NetworkIdentifier is missing in generated Model Design for DI model #629
XmlQualifiedName referenceType = _rfx.GetReferenceTypeName();
string message =
string message =
$"Id = D290E7B4-F77C-4EF0-883B-844F66471DB6; Reference {nameof(ReferenceKindEnum.HierarchicalReferences)} is not supported. Removed the graph at {referenceType.ToString()} of nodes from the model";
_TraceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.DiagnosticInformation, message));
break;
Expand Down Expand Up @@ -285,6 +287,7 @@ public XmlQualifiedName ExportBrowseNameBaseType(Action<NodeId> traceEvent)
public Dictionary<string, IUANodeBase> GetDerivedInstances()
{
if (m_InGetDerivedInstances)
//Improve GetDerivedInstances to log a message instead of throwing exception #651
throw new ArgumentOutOfRangeException($"Circular loop in {nameof(GetDerivedInstances)}"); //TODO replace by the message - it is just model error.
try
{
Expand Down

0 comments on commit 3d76ee0

Please sign in to comment.