<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:51:52 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>[SERVER-19720] add a std::error_category for MongoDB error codes</title>
                <link>https://jira.mongodb.org/browse/SERVER-19720</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In NetworkInterfaceASIO, we often need to indicate error conditions by returning an instance of std::error_code. As we have our own error code space (the codes defined in error_codes.err), we should have our own error category so that we don&apos;t collide with any system codes.&lt;/p&gt;

&lt;p&gt;We will probably also need to generate the code from error_codes.err so that we can convert the codes to their associated strings.&lt;/p&gt;</description>
                <environment></environment>
        <key id="223837">SERVER-19720</key>
            <summary>add a std::error_category for MongoDB error codes</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="adam.midvidy">Adam Midvidy</assignee>
                                    <reporter username="adam.midvidy">Adam Midvidy</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Aug 2015 15:21:23 +0000</created>
                <updated>Sat, 19 Sep 2015 00:09:22 +0000</updated>
                            <resolved>Thu, 13 Aug 2015 21:19:52 +0000</resolved>
                                                    <fixVersion>3.1.7</fixVersion>
                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1006224" author="xgen-internal-githook" created="Fri, 14 Aug 2015 20:49:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;amidvidy&apos;, u&apos;name&apos;: u&apos;Adam Midvidy&apos;, u&apos;email&apos;: u&apos;amidvidy@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19720&quot; title=&quot;add a std::error_category for MongoDB error codes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19720&quot;&gt;&lt;del&gt;SERVER-19720&lt;/del&gt;&lt;/a&gt; don&apos;t compare error codes against ErrorCodes::OK due to MSVC&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/292cf22afced2c652c11012be931d99f2acdd485&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/292cf22afced2c652c11012be931d99f2acdd485&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1005033" author="xgen-internal-githook" created="Thu, 13 Aug 2015 21:18:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;amidvidy&apos;, u&apos;name&apos;: u&apos;Adam Midvidy&apos;, u&apos;email&apos;: u&apos;amidvidy@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19720&quot; title=&quot;add a std::error_category for MongoDB error codes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19720&quot;&gt;&lt;del&gt;SERVER-19720&lt;/del&gt;&lt;/a&gt; harmonize handling of std::error_code and ErrorCodes in NetworkInterfaceASIO&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/870efac99e9195c03389645df3da5a27a388102d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/870efac99e9195c03389645df3da5a27a388102d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1004772" author="xgen-internal-githook" created="Thu, 13 Aug 2015 18:43:53 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;amidvidy&apos;, u&apos;name&apos;: u&apos;Adam Midvidy&apos;, u&apos;email&apos;: u&apos;amidvidy@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19720&quot; title=&quot;add a std::error_category for MongoDB error codes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19720&quot;&gt;&lt;del&gt;SERVER-19720&lt;/del&gt;&lt;/a&gt; add missing BOOST_NOEXCEPT to fix MSVC&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7de54a86f4fc04a5ce7d2e9f8ba7ab84fecd318d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7de54a86f4fc04a5ce7d2e9f8ba7ab84fecd318d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1004730" author="xgen-internal-githook" created="Thu, 13 Aug 2015 18:17:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;amidvidy&apos;, u&apos;name&apos;: u&apos;Adam Midvidy&apos;, u&apos;email&apos;: u&apos;amidvidy@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19720&quot; title=&quot;add a std::error_category for MongoDB error codes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19720&quot;&gt;&lt;del&gt;SERVER-19720&lt;/del&gt;&lt;/a&gt; fix lint&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9eadefd1f5e9f9a480f14fe5ad0b1b1838e96005&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9eadefd1f5e9f9a480f14fe5ad0b1b1838e96005&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1004666" author="xgen-internal-githook" created="Thu, 13 Aug 2015 17:46:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;amidvidy&apos;, u&apos;name&apos;: u&apos;Adam Midvidy&apos;, u&apos;email&apos;: u&apos;amidvidy@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19720&quot; title=&quot;add a std::error_category for MongoDB error codes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19720&quot;&gt;&lt;del&gt;SERVER-19720&lt;/del&gt;&lt;/a&gt; add a std::error_category() for MongoDB error codes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/34618123fd568b02a93c294768cb2b5afc54798b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/34618123fd568b02a93c294768cb2b5afc54798b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="995886" author="adam.midvidy" created="Tue, 4 Aug 2015 12:15:47 +0000"  >&lt;p&gt;Yeah, you&apos;re right that we don&apos;t need code generation. However, the &amp;lt;system_error&amp;gt; API added in C++11 is actually a bit complex. Note that the STL provides both &lt;a href=&quot;http://en.cppreference.com/w/cpp/error/error_code&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;std::error_code&lt;/a&gt; and &lt;a href=&quot;http://en.cppreference.com/w/cpp/error/error_condition&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;std::error_condition&lt;/a&gt;, which represent platform specific and platform independent errors, respectively. Since our ErrorCodes are platform independent, we really should be using std::error_condition, but we need to be able to create instances of std::error_code as well to interoperate with ASIO.  As such, there are a few things I think we need to do:&lt;/p&gt;

&lt;p&gt;1) Add an implementation of mongo_error_category that extends &lt;a href=&quot;http://en.cppreference.com/w/cpp/error/error_category&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;std::error_category&lt;/a&gt;. As you noted, most of the virtual functions we need to implement can be implemented using the existing logic in ErrorCodes.&lt;/p&gt;

&lt;p&gt;2)  Add an overload of &lt;a href=&quot;http://en.cppreference.com/w/cpp/io/io_errc/make_error_code&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;make_error_code&lt;/a&gt; for ErrorCodes::Error.&lt;/p&gt;

&lt;p&gt;3) Add an overload of &lt;a href=&quot;http://en.cppreference.com/w/cpp/io/io_errc/make_error_condition&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;make_error_condition&lt;/a&gt; for ErrorCodes::Error&lt;/p&gt;

&lt;p&gt;4) specialize &lt;a href=&quot;http://en.cppreference.com/w/cpp/error/error_code/is_error_code_enum&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;is_error_code_enum&lt;/a&gt; for ErrorCodes::Error&lt;/p&gt;

&lt;p&gt;5) specialize &lt;a href=&quot;http://en.cppreference.com/w/cpp/error/error_condition/is_error_condition_enum&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;is_error_condition_enum&lt;/a&gt; for ErrorCodes::Error&lt;/p&gt;

&lt;p&gt;For reference, here are two blog posts by the author of ASIO, who played a major role in designing the &amp;lt;system_error&amp;gt; API for C++11:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-4.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-4.html&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-5.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-5.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="995614" author="schwerin" created="Mon, 3 Aug 2015 23:43:34 +0000"  >&lt;p&gt;Given an error_code with appropriate category, err, I believe we can write ErrorCodes::errorString(static_cast&amp;lt;ErrorCodes::Error&amp;gt;(err.value())). I don&apos;t think it needs to be auto-generated. A handful of functions, possibly in status.h, seem appropriate:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;std::error_code toStdErrorCode(ErrorCodes::Error);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;ErrorCodes::Error toMongoErrorCode(std::error_code);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;stdErrorCodeToString(std::error_code); // ?&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 3 Aug 2015 23:43:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 26 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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>PM-58</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 26 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>adam.midvidy</customfieldvalue>
            <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkyqn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hscadj:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="628">Platform 8 08/28/15</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs4o3b:</customfieldvalue>

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