<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:23:46 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETVIRT-1320] Best practices around errors and exceptions by applications</title>
                <link>https://jira.opendaylight.org/browse/NETVIRT-1320</link>
                <project id="10144" key="NETVIRT">netvirt</project>
                    <description>&lt;p&gt;Document and implement best practices for error and exceptions handling by applications. &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; is a thread starting the conversation and the first thoughts are also below.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;https://lists.opendaylight.org/pipermail/netvirt-dev/2018-June/007027.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://lists.opendaylight.org/pipermail/netvirt-dev/2018-June/007027.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my mind, handling exceptions serves two main purposes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;prevent errors from cascading;&lt;/li&gt;
	&lt;li&gt;provide appropriate diagnostics for (a) the end user and (b)&lt;br/&gt;
  technical support (whatever form that may take).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The first of these means that we shouldn&#8217;t swallow exceptions: if an&lt;br/&gt;
error occurs, we need to propagate it back up to whatever level makes&lt;br/&gt;
sense, cancelling transactions as we go. This meshes quite nicely with&lt;br/&gt;
our existing recommendation for transaction handling, at least as a&lt;br/&gt;
goal, which is, as far as possible, to open a transaction (or however&lt;br/&gt;
many transactions are necessary) at the highest possible level, and use&lt;br/&gt;
that for all subsequent method calls. There are a couple places where&lt;br/&gt;
I&#8217;ve refactored code to do that, I&#8217;ll find them and follow up. The&lt;br/&gt;
basic idea is in most cases to open a ReadWriteTransaction in listeners&lt;br/&gt;
or RPC handlers, and pass it to all methods being called.&lt;/p&gt;

&lt;p&gt;The second of these typically means that we need to log something&lt;br/&gt;
somewhere. There&#8217;s a general rule of error handling which says that&lt;br/&gt;
whenever you catch an exception, you should either log it or rethrow&lt;br/&gt;
it, but not both; that usually means that you log at the top level, not&lt;br/&gt;
below, which can mean information is lost. In typical ODL cases it&lt;br/&gt;
probably means we should log in the &#8220;first chance&#8221; exception handler&lt;br/&gt;
(i.e. closest to where we notice the exception), and again at the top&lt;br/&gt;
level. The first log there addresses the tech support diagnostic use&lt;br/&gt;
case, the second addresses the end-user information use case.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30156">NETVIRT-1320</key>
            <summary>Best practices around errors and exceptions by applications</summary>
                <type id="10102" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10316&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="30154">NETVIRT-1318</parent>
                                    <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="1" iconUrl="https://jira.opendaylight.org/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="k.faseela">Faseela K</assignee>
                                    <reporter username="shague">Sam Hague</reporter>
                        <labels>
                            <label>csit:3node</label>
                    </labels>
                <created>Tue, 19 Jun 2018 19:12:53 +0000</created>
                <updated>Tue, 4 Aug 2020 12:47:27 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03fpz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>