aboutsummaryrefslogtreecommitdiff
path: root/lib/http
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-07-08 18:07:41 +0700
committerShulhan <m.shulhan@gmail.com>2020-07-08 18:07:56 +0700
commit2dac51c48b32faa0679dc4639e6bd03eaf587fba (patch)
treecb695f7215f2dbf3b3810fabfe9542a897739218 /lib/http
parentcb1b7dc8c8a188acf1b5661251052bfb8a6b4673 (diff)
downloadpakakeh.go-2dac51c48b32faa0679dc4639e6bd03eaf587fba.tar.xz
http: do not return error based on response code on client.doRequest
The error in doRequest should be about connection error, everything else should be handled by user.
Diffstat (limited to 'lib/http')
-rw-r--r--lib/http/client.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/http/client.go b/lib/http/client.go
index 5c88a989..e141ead1 100644
--- a/lib/http/client.go
+++ b/lib/http/client.go
@@ -25,7 +25,6 @@ import (
"time"
"github.com/shuLhan/share"
- liberrors "github.com/shuLhan/share/lib/errors"
)
const (
@@ -227,14 +226,6 @@ func (client *Client) doRequest(
return httpRes, resBody, err
}
- if httpRes.StatusCode >= 400 {
- e := &liberrors.E{
- Code: httpRes.StatusCode,
- Message: httpRes.Status,
- }
- return httpRes, resBody, e
- }
-
resBody, err = client.uncompress(httpRes, resBody)
return httpRes, resBody, err