Browse Source

Error should be called `err` for consistency (#347)

no-retry
Luke Childs 8 years ago
committed by Sindre Sorhus
parent
commit
a4eb37b8d0
  1. 4
      index.js

4
index.js

@ -171,9 +171,9 @@ function asPromise(opts) {
if (opts.json && res.body) {
try {
res.body = JSON.parse(res.body);
} catch (e) {
} catch (err) {
if (statusCode >= 200 && statusCode < 300) {
throw new got.ParseError(e, statusCode, opts, data);
throw new got.ParseError(err, statusCode, opts, data);
}
}
}

Loading…
Cancel
Save