From 3c66bd74c7bce044cb03c82e78a8f28c8bc03dfe Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Fri, 20 Nov 2015 22:57:28 +0500 Subject: [PATCH] use string templates where appropriate --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 62bfbd8..712b9e2 100644 --- a/index.js +++ b/index.js @@ -192,7 +192,7 @@ function asStream(opts) { function normalizeArguments(url, opts) { if (typeof url !== 'string' && typeof url !== 'object') { - throw new Error('Parameter `url` must be a string or object, not ' + typeof url); + throw new Error(`Parameter \`url\` must be a string or object, not ${typeof url}`); } if (typeof url === 'string') { @@ -350,7 +350,7 @@ got.HTTPError = createErrorClass('HTTPError', function (statusCode, opts) { stdError.call(this, {}, opts); this.statusCode = statusCode; this.statusMessage = nodeStatusCodes[this.statusCode]; - this.message = 'Response code ' + this.statusCode + ' (' + this.statusMessage + ')'; + this.message = `Response code ${this.statusCode} (${this.statusMessage})`; }); got.MaxRedirectsError = createErrorClass('MaxRedirectsError', function (statusCode, opts) {