aboutsummaryrefslogtreecommitdiff
path: root/web/error.go
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2019-02-02 06:53:12 -0800
committerChristine Dodrill <me@christine.website>2019-02-02 06:53:12 -0800
commit7bcfbc6a4da40f498af83e40c3c57ef02ec212cf (patch)
treeee224b7b08722e06d78f49bc557249891264e38f /web/error.go
parentda3595468056f1dd04d79c908f8a65dc0c5a397f (diff)
downloadx-7bcfbc6a4da40f498af83e40c3c57ef02ec212cf.tar.xz
x-7bcfbc6a4da40f498af83e40c3c57ef02ec212cf.zip
web: use error type, simplify some code
Diffstat (limited to 'web/error.go')
-rw-r--r--web/error.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/web/error.go b/web/error.go
index 051d61d..d5ff31a 100644
--- a/web/error.go
+++ b/web/error.go
@@ -13,6 +13,8 @@ import (
// NewError creates an Error based on an expected HTTP status code vs data populated
// from an HTTP response.
+//
+// This consumes the body of the HTTP response.
func NewError(wantStatusCode int, resp *http.Response) error {
data, err := ioutil.ReadAll(resp.Body)
if err != nil {