You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2020/12/21 09:11:05 UTC
[couchdb-nano] branch main updated: Fix invalid parameters error
stack trace (#244)
This is an automated email from the ASF dual-hosted git repository.
glynnbird pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git
The following commit(s) were added to refs/heads/main by this push:
new 64ba7c4 Fix invalid parameters error stack trace (#244)
64ba7c4 is described below
commit 64ba7c4ac412c3272bf26ad5b1f617c2028feb9c
Author: Sam Holmes <sa...@gmail.com>
AuthorDate: Mon Dec 21 01:10:55 2020 -0800
Fix invalid parameters error stack trace (#244)
---
lib/nano.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/nano.js b/lib/nano.js
index 3bd1d81..cf6773a 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -14,7 +14,6 @@ const { URL } = require('url')
const assert = require('assert')
const querystring = require('qs')
const axios = require('axios').default
-const INVALID_PARAMETERS_ERROR = new Error('Invalid parameters')
const stream = require('stream')
const http = require('http')
const https = require('https')
@@ -47,7 +46,7 @@ function missing (...params) {
}
// calls the supplied callback or if not supplied, returns a rejected promise
-function callbackOrRejectError (callback, error = INVALID_PARAMETERS_ERROR) {
+function callbackOrRejectError (callback, error = new Error('Invalid parameters')) {
if (callback) {
return callback(error, null)
} else {