From c162d83e0a42386294844c886c61967c1704f4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Martin?= Date: Mon, 7 Oct 2019 03:25:11 +0200 Subject: [PATCH] feat: improve error output by showing which URL caused the error (#1735) After getting an error in the interceptor, mentioning URL's need to start with a slash, it was difficult to find out which URL was causing the issue. With this change, since the URL is included in the error message, it's easier to troubleshoot the issue. --- lib/interceptor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/interceptor.js b/lib/interceptor.js index 35e4314c5..a7ca885aa 100644 --- a/lib/interceptor.js +++ b/lib/interceptor.js @@ -34,7 +34,7 @@ module.exports = class Interceptor { // we only need to check strings. if (uriIsStr && /^[^/*]/.test(uri)) { throw Error( - "Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything)" + `Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything) (got: ${uri})` ) }