[SERVER-30580] Unify implementations of Status and DBException Created: 09/Aug/17  Updated: 30/Oct/23  Resolved: 16/Aug/17

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.5.12

Type: Task Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-30279 uassertStatusOK() and appendCommandSt... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Repl 2017-08-21
Participants:
Linked BF Score: 0

 Description   

This is prep work for a larger improvement to our error handling code. This ticket covers:

  • Removing location() from status and the _shard member from DBException, so that they logically hold the same data
  • Make DBException hold a Status and kill off the ExceptionInfo type
  • Make log() << ErrorCodes::SomeError use the name of the error
    rather than the number
  • Make argument order consistently code then message
  • Flatten class hierarchy to eliminate MsgAssertionException and UserException into AssertionException. All other
    types will remain, as will the various assert macros which will now
    just throw AssertionException. The difference between massert vs uassert will
    now just that massert logs.


 Comments   
Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Always use errorString() when streaming an ErrorCode::Error
Branch: master
https://github.com/mongodb/mongo/commit/fe72cc35ff8af7bf421d29c668e4d50c048d141b

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 StringData-ify error handling functions
Branch: master
https://github.com/mongodb/mongo/commit/dee1c5c4bf9d15d8ee7138130ad097a4ee7e523b

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Eliminate UserException and MsgAssertionException types

All users were converted to just use AssertionException.
Branch: master
https://github.com/mongodb/mongo/commit/347935f7a5d0452146b1a73ad7ef9e249eaf1fb5

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Make argument order consistently code then message
Branch: master
https://github.com/mongodb/mongo/commit/cdf7aacb213c99d3ce620761ff46b030bbd7732d

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Eliminate DBException::getCode() in favor of code()
Branch: master
https://github.com/mongodb/mongo/commit/5a1b0681dcee481f631dc647000b895e20cc7cfd

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Make DBException hold a Status
Branch: master
https://github.com/mongodb/mongo/commit/c593ea7bb9815ced064ad8aa7ffa206fa94757c4

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 No more status locations
Branch: master
https://github.com/mongodb/mongo/commit/40036f67d0c15e2cd319e82f8c6a1e691fb74806

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'mathias@10gen.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Remove DBException::_shard member

It was only used for a very old form of error reporting which may already be
dead code.
Branch: master
https://github.com/mongodb/mongo/commit/53a9b329fbf1a6d8b620fee2cbb2ef1c27ddd3f3

Comment by Githook User [ 16/Aug/17 ]

Author:

{'username': 'RedBeard0531', 'email': 'redbeard0531@gmail.com', 'name': 'Mathias Stearn'}

Message: SERVER-30580 Enterprise fixes for Status/DBException unification
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/dd4b319cfb2f831d6dc56313a9776f03a1c6d7e7

Generated at Thu Feb 08 04:24:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.