ArcGIS Pro 2.8 API Reference Guide
GetErrors Method
Example 

ArcGIS.Core.Data.Topology Namespace > Topology Class : GetErrors Method
The ErrorDescription which describes the details of how topology errors should be retrieved.
Gets the error features associated with a topology. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

description
The ErrorDescription which describes the details of how topology errors should be retrieved.

Return Value

A list of TopologyError. If no error feature exists that matches the specification in description, an empty list is returned.
Exceptions
ExceptionDescription
description is null.
A geodatabase-related exception has occurred.
Example
// Get all the errors and exceptions currently associated with the topology.

IReadOnlyList<TopologyError> allErrorsAndExceptions = topology.GetErrors(new ErrorDescription(topology.GetExtent()));
Console.WriteLine($"errors and exceptions count => {allErrorsAndExceptions.Count}");
        
Console.WriteLine("OriginClassName \t OriginObjectID \t DestinationClassName \t DestinationObjectID \t RuleType \t IsException \t Shape type \t Shape width & height \t  Rule ID \t");

foreach (TopologyError error in allErrorsAndExceptions)
{
  Console.WriteLine($"'{error.OriginClassName}' \t {error.OriginObjectID} \t '{error.DestinationClassName}' \t " +
                    $"{error.DestinationObjectID} \t {error.RuleType} \t {error.IsException} \t {error.Shape.GeometryType} \t " +
                    $"{error.Shape.Extent.Width},{error.Shape.Extent.Height} \t {error.RuleID}");
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Topology Class
Topology Members