Skip to content

Commit

Permalink
Fix test from #384
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 15, 2017
1 parent 1e682af commit 2bc2b90
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test.serial('http.request error', async t => {
throw new TypeError('The header content contains invalid characters');
});
const err = await t.throws(got(s.url));
t.truthy(err instanceof TypeError);
t.regex(err.message, /The header content contains invalid characters/);
stub.restore();
});
Expand Down

2 comments on commit 2bc2b90

@sindresorhus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukechilds I had to remove this check as cacheable-request turns all errors into CacheError. I don't think it should do that.

@lukechilds
Copy link
Contributor

@lukechilds lukechilds commented on 2bc2b90 Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, it only incorrectly returns CacheErrors when the request fn throws rather than emits an error.

All other errors are properly thrown as got.RequestError, got.HTTPError etc.

Please sign in to comment.