[SERVER-10721] Add an error code for "no such cmd: <command name>" Created: 09/Sep/13  Updated: 30/Oct/15  Resolved: 25/Sep/13

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

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

Issue Links:
Depends
is depended on by DRIVERS-103 Manipulate user objects exclusively v... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The error raised for a non-existent command doesn't currently include an error code. For example:

> db.runCommand('foobar')
{
	"ok" : 0,
	"errmsg" : "no such cmd: foobar",
	"bad cmd" : {
		"foobar" : 1
	}
}

Drivers need an error code here to distinguish this case from other failure cases related to the new user manipulation commands (SERVER-6246).

The error code has to remain the same in future releases since driver code will rely on it's value.



 Comments   
Comment by auto [ 25/Sep/13 ]

Author:

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

Message: SERVER-10721 Add error code for running a command that doesn't exist
Branch: master
https://github.com/mongodb/mongo/commit/366dee7392723b826f7409359f77be8efb863822

Comment by Andy Schwerin [ 24/Sep/13 ]

We should probably document the fact that "command not found" will now return an error code, and what versions of the product have such behavior.

Comment by Andy Schwerin [ 09/Sep/13 ]

Recommend adding a NoSuchCommand error code to error_codes.py, and using that in the "code" field.

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