Skip to content

Commit d66f818

Browse files
committed
refactor: remove an unnecessary log prefix from node fetch errors
1 parent 4188546 commit d66f818

20 files changed

+20
-20
lines changed

src/targets/node/fetch/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const fetch: Client = {
132132
push('fetch(url, options)');
133133
push('.then(res => res.json())', 1);
134134
push('.then(json => console.log(json))', 1);
135-
push(".catch(err => console.error('error:' + err));", 1);
135+
push('.catch(err => console.error(err));', 1);
136136

137137
return join()
138138
.replace(/'encodedParams'/, 'encodedParams')

src/targets/node/fetch/fixtures/application-form-encoded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ const options = {
1212
fetch(url, options)
1313
.then(res => res.json())
1414
.then(json => console.log(json))
15-
.catch(err => console.error('error:' + err));
15+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/application-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ const options = {
1515
fetch(url, options)
1616
.then(res => res.json())
1717
.then(json => console.log(json))
18-
.catch(err => console.error('error:' + err));
18+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET', headers: {cookie: 'foo=bar; bar=baz'}};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/custom-method.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'PROPFIND'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/full.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ const options = {
1515
fetch(url, options)
1616
.then(res => res.json())
1717
.then(json => console.log(json))
18-
.catch(err => console.error('error:' + err));
18+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ const options = {
1212
fetch(url, options)
1313
.then(res => res.json())
1414
.then(json => console.log(json))
15-
.catch(err => console.error('error:' + err));
15+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/http-insecure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/jsonObj-multiline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ const options = {
88
fetch(url, options)
99
.then(res => res.json())
1010
.then(json => console.log(json))
11-
.catch(err => console.error('error:' + err));
11+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/jsonObj-null-value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ const options = {
88
fetch(url, options)
99
.then(res => res.json())
1010
.then(json => console.log(json))
11-
.catch(err => console.error('error:' + err));
11+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/multipart-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ const options = {method: 'POST', body: formData};
1010
fetch(url, options)
1111
.then(res => res.json())
1212
.then(json => console.log(json))
13-
.catch(err => console.error('error:' + err));
13+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/multipart-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const options = {method: 'POST', body: formData};
99
fetch(url, options)
1010
.then(res => res.json())
1111
.then(json => console.log(json))
12-
.catch(err => console.error('error:' + err));
12+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/multipart-form-data-no-params.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'POST', headers: {'Content-Type': 'multipart/form-data'
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/multipart-form-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ const options = {method: 'POST', body: formData};
77
fetch(url, options)
88
.then(res => res.json())
99
.then(json => console.log(json))
10-
.catch(err => console.error('error:' + err));
10+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/nested.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/postdata-malformed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'POST', headers: {'content-type': 'application/json'}};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/query-encoded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/short.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'GET'};
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

src/targets/node/fetch/fixtures/text-plain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const options = {method: 'POST', headers: {'content-type': 'text/plain'}, body:
44
fetch(url, options)
55
.then(res => res.json())
66
.then(json => console.log(json))
7-
.catch(err => console.error('error:' + err));
7+
.catch(err => console.error(err));

0 commit comments

Comments
 (0)