<?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: Error handling and logging when developing ArcMap Add-Ins? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236391#M6110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6956&amp;amp;pid=6947&amp;amp;topicname=Error_reporting_for_ArcGIS_software_crash_data"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6956&amp;amp;pid=6947&amp;amp;topicname=Error_reporting_for_ArcGIS_software_crash_data&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Dec 2012 13:12:43 GMT</pubDate>
    <dc:creator>RichardWatson</dc:creator>
    <dc:date>2012-12-13T13:12:43Z</dc:date>
    <item>
      <title>Error handling and logging when developing ArcMap Add-Ins?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236388#M6107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) Error handling and logging&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the best practice for error handling when developing ArcMap Add-Ins?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If an unhandled exception occurs, ArcMap just closes und presents an "Please inform ESRI about this problem"-dialog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to change this behaviour to get the originial error message and/or at least some rough hints where the code failed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is there any kind of errorlog, which gives more informations for the developer? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) exception handling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the recommended way to handle exception? Is there any reluctance about Try..Catch on the most damageable spots?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any hints or tips appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TIA,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fossi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 08:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236388#M6107</guid>
      <dc:creator>FossiG_</dc:creator>
      <dc:date>2012-12-13T08:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling and logging when developing ArcMap Add-Ins?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236389#M6108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I do not believe that ArcMap provides any logging mechanism so you are left with providing your own.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are many possibilities here including using built-in .NET tracing or various open source logging systems such as log4net.&amp;nbsp; Everyone has their favorite.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The key elements are logging which can be viewed via some type of trace viewer (such as Debug View from SysInternals), to a custom log file, and to the NT event log.&amp;nbsp; In the application I work on, we log critical errors to the NT event log, everything to the trace viewer, and a configurable level of logging to a log file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you code might look like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; // application logic&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;catch (Exception e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; // log e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; throw;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is great debate with regards to whether or not you should eat exceptions that are not expected.&amp;nbsp; Run FxCop on your code you will see that the Microsoft Framework Guidelines do not recommend doing this.&amp;nbsp; You have to judge this for yourself.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 09:59:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236389#M6108</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2012-12-13T09:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling and logging when developing ArcMap Add-Ins?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236390#M6109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Richard,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your reply. I will implement some logging and exception handling myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody an idea about disabling this "Please inform ESRI about this problem"-dialog during development to get original error messages?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TIA,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fossi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 12:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236390#M6109</guid>
      <dc:creator>FossiG_</dc:creator>
      <dc:date>2012-12-13T12:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling and logging when developing ArcMap Add-Ins?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236391#M6110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6956&amp;amp;pid=6947&amp;amp;topicname=Error_reporting_for_ArcGIS_software_crash_data"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6956&amp;amp;pid=6947&amp;amp;topicname=Error_reporting_for_ArcGIS_software_crash_data&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 13:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236391#M6110</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2012-12-13T13:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling and logging when developing ArcMap Add-Ins?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236392#M6111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah, okay. Perhaps I misunderstood this dialog a little. This clarifies some things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will examine the crash dump files a little closers, perhaps they deliver some hints. Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fossi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 14:14:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-handling-and-logging-when-developing-arcmap/m-p/236392#M6111</guid>
      <dc:creator>FossiG_</dc:creator>
      <dc:date>2012-12-13T14:14:19Z</dc:date>
    </item>
  </channel>
</rss>

