apache / couchdb-nano

Nano: The official Apache CouchDB library for Node.js
https://www.npmjs.com/package/nano
Apache License 2.0
651 stars 165 forks source link

Incorrect stack trace for "Invalid parameters" #243

Closed samholmes closed 3 years ago

samholmes commented 3 years ago

https://github.com/apache/couchdb-nano/blob/f708ba043a83f18aa73ed27ebc73b320530c43eb/lib/nano.js#L17

Because the error is instantiated at the module's global scope, the stack trace is static. This error needs to be instantiated where it is thrown in order to show the correct stack trace for this error.