Expose MongoDB Error Types

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: TypeScript
    • Not Needed
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      As a developer, I should be able to access MongoDB Error Types so that I can use error codes or messages better in my application.

      For Example: If I have a social media application with the below "user follow model":

      user: ObjectId("xxxxxxx"),

      follower: ObjectId("xxxxxx"),

      And user clicks the follow button again, MongoDB throws an error that has a code of 11000, I should be able to handle this error instead of checking the code and manually checking for if error.code = 11000.

            Assignee:
            Unassigned
            Reporter:
            Bhupen Pal
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: