-
The error probably is a MongoServerError, not MongoError, see https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/errors.md
-
SurveyJS
SurveyJS: Build JSON-Driven Surveys and Forms with Full Data Control. Add the SurveyJS UI components to your JS app (React/Angular/Vue3). Securely collect and analyze data without sending it to 3rd-party servers. Fully customizable, works with any backend, and ideal for data-heavy apps. Learn more.
-
You encountered probably the only case in the driver this happens lol. When constructing the client, the driver uses a class called ConnectionString from another mongodb maintained library (mongo connection string url). In this class, the url is parsed and if the url is malformed, the MongoParseError is thrown. But this is a third party library, so it doesn't have access to the errors defined in the driver. To get around this, it defines a fake MongoParseError here. Because this class isn't the same error class as the driver's error class and it only extends Error, the instanceof check breaks.