Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HTTP errors #1253

Merged
merged 5 commits into from
Aug 29, 2019
Merged

Improve HTTP errors #1253

merged 5 commits into from
Aug 29, 2019

Conversation

Gabriella439
Copy link
Collaborator

Fixes #1251

This improves HTTP error messages by:

  • Expanding the set of recognized status codes
  • Adding up to 7 lines of the response body

For example:

Error: Remote file missing

URL:

↳ https://httpbin.org/statu

Message:

1│ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2│ <title>404 Not Found</title>
3│ <h1>Not Found</h1>
4│ <p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>

Fixes #1251

This improves HTTP error messages by:

* Expanding the set of recognized status codes
* Adding up to 7 lines of the response body

For example:

```
Error: Remote file missing

URL:

↳ https://httpbin.org/statu

Message:

1│ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2│ <title>404 Not Found</title>
3│ <h1>Not Found</h1>
4│ <p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>
```
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

How about including the status code in any case?! That might help make the problem more googlable and even easier to diagnose.

This is closer to the official wording for the error message
There's no need to put the URL and status code on separate lines since
they are compact
@mergify mergify bot merged commit 9ff63b2 into master Aug 29, 2019
@mergify mergify bot deleted the gabriel/improved_http_errors branch August 29, 2019 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fetching with Authorization Header
2 participants