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

Make all name properties on Errors readonly

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.0.0
    • Affects Version/s: None
    • Component/s: None
    • Not Needed

      Use Case

      It is desirable to check an Error's type by inspecting the name property of the error. We should make all the name properties getters only, to ensure it can't be changed after creation.

      Dependencies

      • All the errors defined in 4.0

      Unknowns

      • Will typescript be mad about subclasses returning a different type? (If we use the name as the return type vs general string)

      Acceptance Criteria

      Implementation Requirements
      • get name() on each error class
      Testing Requirements
      • A test to assert the names are what we expect should serve here to prevent regression and check readonly behavior.
      Documentation Requirements
      • None
      Follow Up Requirements
      • None

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

              Created:
              Updated:
              Resolved: