ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core.Geoprocessing Namespace / IGPResult Interface / ErrorMessages Property
Example

In This Topic
    ErrorMessages Property (IGPResult)
    In This Topic
    Returns error messages - see code example below:
    Syntax
    IEnumerable<IGPMessage> ErrorMessages {get;}
    ReadOnly Property ErrorMessages As IEnumerable(Of IGPMessage)
    Example
    var warnings = result.Messages.Where(it => it.Type == GPMessageType.Error);
    Multi Ring Buffer
    //The data referenced in this snippet can be downloaded from the arcgis-pro-sdk-community-samples repo
    //https://github.com/Esri/arcgis-pro-sdk-community-samples
    async Task<IGPResult> CreateRings(EditingTemplate currentTemplate)
          {
              var paramsArray = Geoprocessing.MakeValueArray(currentTemplate.MapMember.Name,
                          @"C:\Data\FeatureTest\FeatureTest.gdb\Points_MultipleRingBuffer",
                          new List<string> { "1000", "2000" }, "Meters", "Distance",
                          "ALL", "FULL");
    
              IGPResult ringsResult = await Geoprocessing.ExecuteToolAsync("Analysis.MultipleRingBuffer", paramsArray);
              var messages = string.IsNullOrEmpty(gpResult.ReturnValue)
                      ? $@"Error in gp tool: {gpResult.ErrorMessages}"
                      : $@"Ok: {gpResult.ReturnValue}";
    
              return ringsResult;
          }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also