[SERVER-4380] audit and clean up shared error code definitions and references Created: 28/Nov/11  Updated: 07/Dec/15  Resolved: 07/Dec/15

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Participants:

 Description   

There are some different places where we use an enum or variable to represent error codes:

    enum CommonErrorCodes {
        DatabaseDifferCaseCode = 13297 ,
        SendStaleConfigCode = 13388 ,
        RecvStaleConfigCode = 9996
    };
 
    enum { ASSERT_ID_DUPKEY = 11000 };
 
    static const int OutOfOrderDocumentsAssertionCode = 14810;

There are probably some others as well. It might be nice to standardize these.

Also, there are some places where we refer to error codes by numeric value and might not want to be doing this. Just grepping for getCode() shows some of these. A couple examples:

                    if( e.getCode() != 15850 )
                        throw;
 
            if( e.getCode() == 10287 && idxNo == d->nIndexes ) {
                DEV log() << "info: caught key already in index on bg indexing (ok)" << endl;
            }



 Comments   
Comment by David Storch [ 07/Dec/15 ]

I think this was resolved with the introduction of standard error codes in src/mongo/base/error_codes.err. Closing as Gone Away.

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