<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:39:13 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>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-2721] Fully support &quot;errors.Is&quot; and &quot;errors.As&quot; in all stable public APIs</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2721</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;The Go driver was built before the &quot;modern&quot; Go error handling paradigm using &lt;tt&gt;errors.Is&lt;/tt&gt; and &lt;tt&gt;errors.As&lt;/tt&gt; were added. As a result, handling errors when using the Go driver frequently requires checking for individual errors, writing error &lt;tt&gt;switch&lt;/tt&gt; statements, and using error helper functions. Additionally, errors returned from the Go driver sometimes lack sufficient information to determine the root cause of an error.&lt;/p&gt;

&lt;p&gt;We should try to reduce the amount of individual error value comparison required and instead aim to support the &lt;tt&gt;errors.Is&lt;/tt&gt; and &lt;tt&gt;errors.As&lt;/tt&gt; for all stable (i.e. not in &lt;tt&gt;x/&lt;/tt&gt; public Go driver APIs.&lt;/p&gt;

&lt;p&gt;Definition of done:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Audit all exported error values and remove those that can be replaced by a class of errors (e.g. &lt;tt&gt;InvalidArgumentError&lt;/tt&gt;, see &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1854&quot; title=&quot;Make &amp;quot;ErrNilDocument&amp;quot; and &amp;quot;ErrNilValue&amp;quot; more specific&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1854&quot;&gt;GODRIVER-1854&lt;/a&gt;).&lt;/li&gt;
	&lt;li&gt;Wrap all errors returned by stable public APIs using &lt;tt&gt;fmt.Errorf(&quot;...: %w&quot;, err)&lt;/tt&gt; or a similar pattern.
	&lt;ul&gt;
		&lt;li&gt;Replace all uses of the internal &lt;tt&gt;errutil.WrapErrorf&lt;/tt&gt; (if it&apos;s still used) with &lt;tt&gt;fmt.Errorf&lt;/tt&gt; using the &quot;%w&quot; verb.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Update tests to use &lt;tt&gt;errors.Is&lt;/tt&gt; and &lt;tt&gt;errors.As&lt;/tt&gt; instead of direct error comparison.&lt;/li&gt;
	&lt;li&gt;Enable the &lt;a href=&quot;https://golangci-lint.run/usage/linters/#errorlint&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;errorlint&lt;/a&gt; linter in &lt;tt&gt;golangci-lint&lt;/tt&gt; to check for error use patterns that cause problems using &lt;tt&gt;errors.Is&lt;/tt&gt; and &lt;tt&gt;errors.As&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;Enable the &lt;a href=&quot;https://golangci-lint.run/usage/linters/#wrapcheck&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;wrapcheck&lt;/a&gt; linter.&lt;/li&gt;
	&lt;li&gt;Consider copying the Go stdlib &lt;a href=&quot;https://cs.opensource.google/go/go/+/refs/tags/go1.20.7:src/errors/join.go;l=13&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;errors.Join&lt;/a&gt; code into the &lt;tt&gt;errutil&lt;/tt&gt; package to support multi-errors.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note: The scope of this ticket is limited to all Go driver code &lt;em&gt;except&lt;/em&gt; the BSON library. See related ticket &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2721&quot; title=&quot;Fully support &amp;quot;errors.Is&amp;quot; and &amp;quot;errors.As&amp;quot; in all stable public APIs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2721&quot;&gt;GODRIVER-2721&lt;/a&gt; for the support in the Go driver BSON library.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2218909">GODRIVER-2721</key>
            <summary>Fully support &quot;errors.Is&quot; and &quot;errors.As&quot; in all stable public APIs</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                            <label>rp-track</label>
                    </labels>
                <created>Fri, 23 Dec 2022 19:11:41 +0000</created>
                <updated>Mon, 8 Jan 2024 21:13:06 +0000</updated>
                                                            <fixVersion>2.0.0</fixVersion>
                                    <component>Error Handling</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2406747">GODRIVER-2929</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2436011">GODRIVER-2975</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2166025">GODRIVER-2603</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-1787</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6jqv:s0000yzu5</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>