[SERVER-12770] return location code when converting Error to string Created: 18/Feb/14  Updated: 11/Jul/16  Resolved: 26/Feb/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.6.0-rc1

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

This should remove the need to add every uassert code to error_codes.err just to avoid getting UnknownError when converting exceptions to Status objects.



 Comments   
Comment by Githook User [ 26/Feb/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-12770 Change stringification and casting of ErrorCodes::Error to improve round-tripping.
Branch: master
https://github.com/mongodb/mongo/commit/c5ce70cdef9102b1f71cbf2beb94da7ebb9f1c5c

Comment by Andy Schwerin [ 18/Feb/14 ]

Proposal:

Error code values, x that are not in the ErrorCodes::Error enumeration will convert to strings of the form "Location" + toDecimalString( x ). Further, ErrorCodes::fromInt will be equivalent to static_cast<ErrorCodes::Error>.

Generated at Thu Feb 08 03:29:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.