Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3484

Extend MongoParseError

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Error

      Use Case

      As a Node driver use
      I want more descriptive parse error types
      So that when something fails, I know where to look for the cause.

      Acceptance Criteria

      Implementation Requirements

      Extend MongoParseError to include the following errors:

      • MongoConnectionStringError
      • MongoMessageStreamParseError
      • MongoBSONParseError
      • MongoInvalidNamespaceError

      The new children errors should be define, implemented, and tested.

      MongoInvalidNamespaceError is a three step process:

      1. Move `validateDatabaseName()` (src/db.ts) and `checkCollectionName()` (src/utils.ts) into the MongoNamespaceObject as static funcs which throw MongoInvalidNameSpaceError.
      2. Replace references to the funcs with these static funcs where appropriate.
      3. Use these funcs to replace raw string parsing where appropriate.
      Testing Requirements

      See the testing plan at [docs/errors.md|http://example.com],

      Documentation Requirements
      • DOCSP ticket, API docs, etc
      Follow Up Requirements
      • additional tickets to file, required releases, etc

            Assignee:
            Unassigned Unassigned
            Reporter:
            andy.mina@mongodb.com Andy Mina
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: