IGeoProcessorResult raise exception

Discussion created by jsn on Mar 3, 2011
Hi all

whenever the IGeoProcessorResult  does not execute correctly  would like to stop my program, to raise  an exception.

This code only shows error messages, bot does not stop the program:

 Execute the server tool
    Dim result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
    result = CType(GP.Execute("CalculateBestPath", parameters, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult)
    If result.Status = esriJobStatus.esriJobSucceeded
        For Count As Integer = 0 To result.MessageCount - 1
        Next Count
    End If