[SERVER-14856] Omit "Undefined" code for any writeError in the shell Created: 11/Aug/14  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jonathan Abrahams Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: 28qa, move-sa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-14601 All "not master" errors should use th... Closed
Participants:

 Description   

A write to a secondary node fails with the following:

WriteResult({ "writeError" : { "code" : undefined, "errmsg" : "not master" } })

There should be a a defined code for every error.

If the code is "undefined", then omit it from the writeError.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Scott Hernandez (Inactive) [ 17/Sep/14 ]

This only affects the shell as the server doesn't supply a code field at all:

> db.a.runCommand({insert:"test.a", documents:{a:1}})
{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" }

Comment by Scott Hernandez (Inactive) [ 11/Aug/14 ]

It is not required and lots of errors that come back to the client don't have a code. Consider the code preferred but optional.

Def. don't see this a bug, but maybe an improvement if anything.

Comment by Jonathan Abrahams [ 11/Aug/14 ]

The errmsg is proper, but there is a code with a value of "undefined". Are there other errors that exhibit this result? Is the code field deprecated?

Comment by Scott Hernandez (Inactive) [ 11/Aug/14 ]

Can you be a bit more clear on "what is the bug"? The error message is clear, consistent, and included in the "writeError".

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