From 3b044962c48fe313905877a96b5d0894a5404f6f Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 2 Apr 2019 03:46:17 +0200 Subject: errors: add more information in case of invalid callbacks This adds the actual callback that is passed through to the error message in case an ERR_INVALID_CALLBACK error is thrown. PR-URL: https://github.com/nodejs/node/pull/27048 Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang --- lib/internal/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/internal/url.js') diff --git a/lib/internal/url.js b/lib/internal/url.js index 6ef2ad3017..442c164829 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1092,7 +1092,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { throw new ERR_INVALID_THIS('URLSearchParams'); } if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(); + throw new ERR_INVALID_CALLBACK(callback); } let list = this[searchParams]; -- cgit v1.2.3