<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to propagate exceptions? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876491#M5433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;‌ thank you for the tips. I did look at several of you and Uma on starting an add-in. I viewed the one on multi threading and things are starting to make more sense. In&amp;nbsp;response to your items:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. After watching your video and you showing me what needs to be done it now works as it should. thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I can code in c# but am not proficient. Over the next year or two I think I will make the transition. That being said, Microsoft are still supporting VB up to and including .NET Core 5 right? There are many developers still writing in VB as it has been our language for some time and I can produce code quite fast. One thing I do think should happen is that the documentation should be updated. For example&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing" title="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing"&gt;ProConcepts Geoprocessing · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;says in the header "&lt;STRONG&gt;Language: C# and Visual Basic&lt;/STRONG&gt;". If no VB samples are provided then the header should not state it. Or it should say something like "Language: C#&amp;nbsp; (translate to VB here) with a link to Telerik Converter or some other online translator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2020 19:19:30 GMT</pubDate>
    <dc:creator>AbelPerez</dc:creator>
    <dc:date>2020-04-28T19:19:30Z</dc:date>
    <item>
      <title>How to propagate exceptions?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876489#M5431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I just started with a Pro add-in and have added a DockPane. The user fills in input and I send that to a geoprocessing function. In the DockPane I have a button with a click event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Sub btnGo_Click(sender As Object, e As RoutedEventArgs) Handles btnGo.Click&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'collect WPF form info&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; DoGp(info)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Catch ex As Exception&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Error)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;End Try&lt;BR /&gt; End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a separate module I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Public Async Sub DoGp(ByVal vg As Info)&lt;BR /&gt; Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim toolPath As String = "management.CreateFishnet"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Dim progDlg As ProgressDialog = New ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, True)&lt;BR /&gt; progDlg.Show()&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Dim progSrc As CancelableProgressorSource = New CancelableProgressorSource(progDlg)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Dim res As IGPResult = Await Geoprocessing.ExecuteToolAsync(toolPath, params, envr, progSrc.Progressor, GPExecuteToolFlags.Default)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;progDlg.Hide()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If res.IsFailed Then Throw New Exception("Geoprocessing tool failed.")&lt;/P&gt;&lt;P&gt;Catch ex As Exception&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.Print(ex.ToString)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Throw&amp;nbsp; &lt;STRONG&gt;'crashes here&lt;/STRONG&gt;&lt;BR /&gt;End Try&lt;BR /&gt; End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run it and there is an error in the output there is an unhandled exception at the line Throw:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;An exception of type 'System.Exception' occurred in MyAddin.dll but was not handled in user code&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Geoprocessing tool failed.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have Try-Catch in the calling code and also in the module so why is it not propagated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2020 03:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876489#M5431</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2020-04-26T03:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to propagate exceptions?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876490#M5432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two suggestions:&lt;/P&gt;&lt;P&gt;1) In your calling code you have to 'await' the outcome of the function you call, currently you only 'initiate' the DoGp method and the call returns back to the calling method before the function is actually executed..&amp;nbsp; Change&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DoGp(info) to 'await&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;DoGp(info)' and make the&amp;nbsp;btnGo_Click an async Sub.&amp;nbsp; Once you 'await' the function you call you will also get the exception from the called function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;2) Since you just started with Pro Add-ins, i would suggest to make the leap to c# instead of using VB.&amp;nbsp; There are all kinds of advantages in using c# over vb.net, for example: VS has much better intellisense support for c#, most add-in samples and all snippets are in c# enabling copy/paste inheritance, this forum supports only a c# syntax highlighter for code snippets, vb is not supported.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 13:56:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876490#M5432</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-04-27T13:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to propagate exceptions?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876491#M5433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;‌ thank you for the tips. I did look at several of you and Uma on starting an add-in. I viewed the one on multi threading and things are starting to make more sense. In&amp;nbsp;response to your items:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. After watching your video and you showing me what needs to be done it now works as it should. thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I can code in c# but am not proficient. Over the next year or two I think I will make the transition. That being said, Microsoft are still supporting VB up to and including .NET Core 5 right? There are many developers still writing in VB as it has been our language for some time and I can produce code quite fast. One thing I do think should happen is that the documentation should be updated. For example&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing" title="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing"&gt;ProConcepts Geoprocessing · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;says in the header "&lt;STRONG&gt;Language: C# and Visual Basic&lt;/STRONG&gt;". If no VB samples are provided then the header should not state it. Or it should say something like "Language: C#&amp;nbsp; (translate to VB here) with a link to Telerik Converter or some other online translator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2020 19:19:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876491#M5433</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2020-04-28T19:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to propagate exceptions?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876492#M5434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Microsoft will continue to support VB and so will the SDK so no worries there.&amp;nbsp; Your point about the documentation is correct and we will update the documentation for the 2.6 release this coming summer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 20:58:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876492#M5434</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-04-30T20:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to propagate exceptions?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876493#M5435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;We updated&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;the documentation for the 2.6 release which is coming out this week.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jul 2020 16:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-propagate-exceptions/m-p/876493#M5435</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-07-26T16:32:37Z</dc:date>
    </item>
  </channel>
</rss>

