{"id":20228312,"url":"https://github.com/matryer/httperr","last_synced_at":"2025-04-10T17:33:25.461Z","repository":{"id":57498402,"uuid":"185622705","full_name":"matryer/httperr","owner":"matryer","description":"HTTP error wrapper","archived":false,"fork":false,"pushed_at":"2019-11-25T17:58:43.000Z","size":19,"stargazers_count":36,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:11:14.784Z","etag":null,"topics":["golang","http"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matryer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-08T14:30:12.000Z","updated_at":"2024-12-04T06:00:31.000Z","dependencies_parsed_at":"2022-08-28T17:13:06.291Z","dependency_job_id":null,"html_url":"https://github.com/matryer/httperr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fhttperr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fhttperr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fhttperr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fhttperr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matryer","download_url":"https://codeload.github.com/matryer/httperr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261993,"owners_count":21074229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http"],"created_at":"2024-11-14T07:29:35.941Z","updated_at":"2025-04-10T17:33:25.397Z","avatar_url":"https://github.com/matryer.png","language":"Go","readme":"# httperr [![GoDoc](https://godoc.org/github.com/matryer/httperr?status.png)](http://godoc.org/github.com/matryer/httperr) [![Go Report Card](https://goreportcard.com/badge/github.com/matryer/httperr)](https://goreportcard.com/report/github.com/matryer/httperr) [![Build Status](https://travis-ci.org/matryer/httperr.svg?branch=master)](https://travis-ci.org/matryer/httperr)\n\nHTTP error wrapper that returns an error if the HTTP request failed (i.e. 404, 500, etc.) as well as\nif any network issues occurred.\n\nThis is useful for cases when you don't care why an HTTP request failed, and would like to treat \nnetwork errors and API errors once.\n\n## Usage\n\n```go\nreq, err := http.NewRequest(http.MethodGet, \"/path\", nil)\nif err != nil {\n\treturn errors.Wrap(err, \"new request\")\n}\nresp, err := httperr.Check(client.Do(req))\nif err != nil {\n\treturn errors.Wrap(err, \"HTTP error\")\n}\ndefer resp.Body.Close()\n// use resp\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatryer%2Fhttperr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatryer%2Fhttperr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatryer%2Fhttperr/lists"}