Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-183

JSON parser needs better context, validation and error messages

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: mongoimport

      This is a considerable problem for usability.

      //from {$undefined:truee}
      Wed Jan 16 20:27:14.514 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '}' or ',': offset:26
      

      There are a few things wrong with this error message:

      1. Doesn't provide output of what was found – there is no context like "truee", or ...
      2. Could provide current doc/level
      3. FailedToParse is repeated (not sure we need this at all)
      4. This is not a helpful string for a user: "BSON representation of supplied JSON is too large"
        • What does BSON have to do with anything... I'm importing JSON
        • "too large", what does that mean? No context nor idea how it too large

      In addition, there was no error that there were more json objects on the same line, nor did it parse them. It just skipped them

      { _id: { $undefined : trueer} }{ "_id" : { "$minKey" : 1 } }{ "_id" : { "$maxKey" : true } }
      
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: