Provide structured error messages

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      A good example of where this is important are things like mapReduce where it might require authentication to two databases but this is generic to all commands/operations.

      Basically, returning an error string is not sufficient all of the time.

      In the case of mapreduce authentication problems with the destination db you might expect something like this:

      {
      	"errmsg" : "exception: unauthorized db:mrtesttarget ns:mrtesttarget.tmp.mr.imr1_0_inc lock type:1 client:127.0.0.1",
      	"code" : 10057,
      	"ok" : 0,
      	"dbs" : [
      		"sourcedb",
      		"mrtesttarget"
      	],
      	"collections" : [
      		"mrtesttarget.tmp.mr.imr1_0_inc"
      	],
      	"client" : "127.0.0.1",
      	"lockTypeRequired" : 1,
      	"retriable" : true,
      	"errors" : [
      		{
      			"db" : "mrtesttarget",
      			"code" : 10057,
      			"errmsg" : "exception: unauthorized ..."
      		}
      	]
      }

            Assignee:
            DO NOT USE - Backlog - Dev Tools
            Reporter:
            Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: