<?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: comprehensive/descriptive catch statements needed in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/comprehensive-descriptive-catch-statements-needed/m-p/621003#M16699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if you use e.toString instead of e.Message, you get the call stack of the error and even the line number if you are running debug code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Showing the user a message box with the error message is not very useful in my experience.&amp;nbsp; I usually log the message somewhere (file or event log) and pop up a message that an error happened and there is a message in a log.&amp;nbsp; The user can then send the log to support.&amp;nbsp; I typically write the message to the trace and have a trace listener write it to a log.&amp;nbsp; That allows you to change how you log things without code changes.&amp;nbsp; Also when you run in debug mode in VS, the trace gets written to the output window so there is no need for message boxes.&amp;nbsp; However, message boxes are useful in debug mode because they are annoying.&amp;nbsp; A developer sufficiently annoyed by a message box will fix it rather than just ignore it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 19:28:42 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2010-11-02T19:28:42Z</dc:date>
    <item>
      <title>comprehensive/descriptive catch statements needed</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/comprehensive-descriptive-catch-statements-needed/m-p/621002#M16698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to provide a more comprehensive and descriptive catch statement besides this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (NullReferenceException e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Debug.WriteLine(e.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Debug.WriteLine(e.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, would it make sense to provide a messagebox.show or a system.diag.debug.writeline? What's the consensus here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Nov 2010 14:54:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/comprehensive-descriptive-catch-statements-needed/m-p/621002#M16698</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-11-01T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: comprehensive/descriptive catch statements needed</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/comprehensive-descriptive-catch-statements-needed/m-p/621003#M16699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if you use e.toString instead of e.Message, you get the call stack of the error and even the line number if you are running debug code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Showing the user a message box with the error message is not very useful in my experience.&amp;nbsp; I usually log the message somewhere (file or event log) and pop up a message that an error happened and there is a message in a log.&amp;nbsp; The user can then send the log to support.&amp;nbsp; I typically write the message to the trace and have a trace listener write it to a log.&amp;nbsp; That allows you to change how you log things without code changes.&amp;nbsp; Also when you run in debug mode in VS, the trace gets written to the output window so there is no need for message boxes.&amp;nbsp; However, message boxes are useful in debug mode because they are annoying.&amp;nbsp; A developer sufficiently annoyed by a message box will fix it rather than just ignore it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 19:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/comprehensive-descriptive-catch-statements-needed/m-p/621003#M16699</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2010-11-02T19:28:42Z</dc:date>
    </item>
  </channel>
</rss>

