<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:12 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>[JAVA-2843] Exceptions should include codeName string from server response</title>
                <link>https://jira.mongodb.org/browse/JAVA-2843</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;As of MongoDB 3.4, error responses from the server include not only the error code and message, but also a stringified representation of the error code, in the codeName field. Drivers should ensure that this code name is accessible from any errors that are returned or exceptions that are raised based on error responses from the server.&lt;/p&gt;

&lt;p&gt;Example responses:&lt;/p&gt;

&lt;p&gt;MongoDB Enterprise repl0:PRIMARY&amp;gt; db.runCommand(&lt;/p&gt;
{insert: &quot;test&quot;, documents: []}
&lt;p&gt;)&lt;/p&gt;
{
	&quot;operationTime&quot; : Timestamp(1524837772, 1),
	&quot;ok&quot; : 0,
	&quot;errmsg&quot; : &quot;Write batch sizes must be between 1 and 100000. Got 0 operations.&quot;,
	&quot;code&quot; : 16,
	&quot;codeName&quot; : &quot;InvalidLength&quot;,
}

&lt;p&gt;MongoDB Enterprise repl0:PRIMARY&amp;gt; db.runCommand({insert: &quot;test&quot;, writeConcern: &lt;/p&gt;
{w: 10}
&lt;p&gt;, documents: &lt;span class=&quot;error&quot;&gt;&amp;#91;{_id: 2}&amp;#93;&lt;/span&gt;})&lt;br/&gt;
{&lt;br/&gt;
	&quot;n&quot; : 1,&lt;br/&gt;
	&quot;opTime&quot; : &lt;/p&gt;
{
		&quot;ts&quot; : Timestamp(1524837850, 1),
		&quot;t&quot; : NumberLong(15)
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;electionId&quot; : ObjectId(&quot;7fffffff000000000000000f&quot;),&lt;br/&gt;
	&quot;writeConcernError&quot; : &lt;/p&gt;
{
		&quot;code&quot; : 100,
		&quot;codeName&quot; : &quot;CannotSatisfyWriteConcern&quot;,
		&quot;errmsg&quot; : &quot;Not enough data-bearing nodes&quot;
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;ok&quot; : 1,&lt;br/&gt;
	&quot;operationTime&quot; : Timestamp(1524837850, 1),&lt;br/&gt;
	&quot;$clusterTime&quot; : {&lt;br/&gt;
		&quot;clusterTime&quot; : Timestamp(1524837850, 1),&lt;br/&gt;
		&quot;signature&quot; : &lt;/p&gt;
{
			&quot;hash&quot; : BinData(0,&quot;AAAAAAAAAAAAAAAAAAAAAAAAAAA=&quot;),
			&quot;keyId&quot; : NumberLong(0)
		}
&lt;p&gt;	}&lt;br/&gt;
}&lt;br/&gt;
Note that a writeConcernError document can also contain a codeName embedded within it. No evidence that the documents within the writeErrors array field do the same.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="535440">JAVA-2843</key>
            <summary>Exceptions should include codeName string from server response</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jeff.yemin@mongodb.com">Jeffrey Yemin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Apr 2018 21:48:53 +0000</created>
                <updated>Sat, 28 Oct 2023 11:22:52 +0000</updated>
                            <resolved>Mon, 30 Apr 2018 14:41:58 +0000</resolved>
                                                    <fixVersion>3.8.0</fixVersion>
                                    <component>Error Handling</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1877702" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Support codeName in error responses from server&lt;/p&gt;

&lt;p&gt;The server introduced a codeName field in error responses, which is a&lt;br/&gt;
stringified version of the integral error code.&lt;/p&gt;

&lt;p&gt;This commit adds a codeName property to MongoCommandException and&lt;br/&gt;
WriteConcernError, which is included in various exception types&lt;br/&gt;
including MongoWriteConcernException.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/dde851ec07143050f26a2590691bae264bfae4d0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/dde851ec07143050f26a2590691bae264bfae4d0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877701" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Add regression test for createWriteConcernHelper&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/b1763a8464dc22167a55d03f308affb5d0a04299&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/b1763a8464dc22167a55d03f308affb5d0a04299&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877700" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:17 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Rename method in WriteConcernHelper&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/920d31e969220cf1ab4c48815b88ba47643036d4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/920d31e969220cf1ab4c48815b88ba47643036d4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877699" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Replace duplicated code with use of WriteConcernHelper&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/8d9477b291f000c81daebe97de1f9c0a65cd4b3f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/8d9477b291f000c81daebe97de1f9c0a65cd4b3f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877698" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Move WriteConcernHelper class to internal package&lt;/p&gt;

&lt;p&gt;Move from com.mongodb.operation to com.mongodb.internal.operation and&lt;br/&gt;
make it public, so that it can be shared by multiple packages&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/84be7abfa518f6d1d3ec2d5f16742e3f1c440d55&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/84be7abfa518f6d1d3ec2d5f16742e3f1c440d55&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877697" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Move serverVersionIsAtLeast... methods&lt;/p&gt;

&lt;p&gt;Move from OperationHelper to ServerVersionHelper class in internal&lt;br/&gt;
package to aid in a subsequent move of WriteConcernHelper to an internal&lt;br/&gt;
package&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/b31de79f011cc3cc0962ad97eec37c3f9c95319f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/b31de79f011cc3cc0962ad97eec37c3f9c95319f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877696" author="xgen-internal-githook" created="Mon, 30 Apr 2018 14:32:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jeff.yemin@10gen.com&apos;, &apos;username&apos;: &apos;jyemin&apos;, &apos;name&apos;: &apos;Jeff Yemin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2843&quot; title=&quot;Exceptions should include codeName string from server response&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2843&quot;&gt;&lt;del&gt;JAVA-2843&lt;/del&gt;&lt;/a&gt;: Move writeConcernErrorTransformer method&lt;/p&gt;

&lt;p&gt;Move from WriteConcernHelper to CommandOperationHelper to aid in a&lt;br/&gt;
subsequent move of WriteConcernHelper to an internal package&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/e09d73f9907f3e2ab63452c2419169a074505de7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/e09d73f9907f3e2ab63452c2419169a074505de7&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="534795">DRIVERS-478</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htnofr:</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>