Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-133

Feature request: Improved error messaging

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Usability
    • None

      Instead of:

      Array
      (
      [err] => E11000 duplicate key errorindex: example.books.$id dup key: { : 3 }
      [n] => 0
      [ok] => 1
      )

      Something like:

      Array
      (
      [err] => Array
      (
      [num] => 11000
      [msg] => duplicate key
      [index] => example.books.$_id
      [key] => 3
      )
      [n] => 0
      [ok] => 1
      )

      This will make it much easier to handle errors in the user's code. Now, the same error can generate different messages (because the messages includes the key on which the method failed), which makes it really hard to distinguish if I'm dealing with a duplicate key error, or another error.

      This goes for all errors of course. Each error message should include a 'num' field, and all errors (with their corresponding numbers) should be listed somewhere on your site.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            wouter Wouter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: