Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4380

audit and clean up shared error code definitions and references

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Diagnostics
    • None

    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;
                  }

      Attachments

        Activity

          People

            Unassigned Unassigned
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: