[SERVER-11337] Make error reporting consistent whenever throwing an exception in a Command Created: 23/Oct/13  Updated: 11/Jul/16  Resolved: 23/Oct/13

Status: Closed
Project: Core Server
Component/s: Security, Usability
Affects Version/s: None
Fix Version/s: 2.5.4

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Participants:

 Description   

Right now, if you throw a UserAssertion in the body of a command, the result object you get back from the command looks like:
{ok: 0,
code: <assertion code>,
errmsg: <assertion message>
}

If you throw an exception from some other part of the command code other than the run method (for example in the access control check or the parseNs method), you get back something like:
{ok: 0,
assertionCode: <assertion code>,
assertion: <assertion message>,
errmsg: "db assertion failure"
}

We should make these consistent



 Comments   
Comment by auto [ 23/Oct/13 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-11337 Make error reporting for exceptions thrown in commands consistent
Branch: master
https://github.com/mongodb/mongo/commit/6c95fdd95c4182cc396c3714a7cf13bbfe627de6

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