ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.KnowledgeGraph Namespace / KnowledgeGraphLayerException Class
Members Example Version

KnowledgeGraphLayerException Class
Managed exception base class for custom ArcGIS.Desktop.Mapping.KnowledgeGraphLayer exceptions
Syntax
public sealed class KnowledgeGraphLayerException : KnowledgeGraphException, System.Runtime.Serialization.ISerializable  
Example
Checking KnowledgeGraphLayerException
// running on QueuedTask

var dict = new Dictionary<string, List<long>>();
dict.Add("person", new List<long>());  //Empty list means all records
dict.Add("made_call", null);  //null list means all records

// or specific records - however the ids are obtained
dict.Add("phone_call", new List<long>() { 1, 5, 18, 36, 78 });

// make the id set
var idSet = KnowledgeGraphLayerIDSet.FromDictionary(kg, dict);

try
{
  //Create the link chart and show it
  var linkChart = MapFactory.Instance.CreateLinkChart(
                    "KG With ID Set", kg, idSet);
  FrameworkApplication.Panes.CreateMapPaneAsync(linkChart);
}
catch (KnowledgeGraphLayerException e)
{
  // get the invalid named types
  //   remember that the named types are case-sensitive
  var invalidNamedTypes = e.InvalidNamedTypes;

  // do something with the invalid named types 
  // for example - log or return to caller to show message to user
}
Inheritance Hierarchy

System.Object
   System.Exception
      ArcGIS.Desktop.KnowledgeGraph.KnowledgeGraphException
         ArcGIS.Desktop.KnowledgeGraph.KnowledgeGraphLayerException

Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.3 or higher.
See Also