mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-27 22:06:24 +02:00
handle error returned when fetching remote images
This commit is contained in:
parent
dae09a8c9d
commit
7994cb2cf6
1 changed files with 3 additions and 0 deletions
|
|
@ -168,6 +168,9 @@ func (t *TransformingTransport) RoundTrip(req *http.Request) (*http.Response, er
|
||||||
u := *req.URL
|
u := *req.URL
|
||||||
u.Fragment = ""
|
u.Fragment = ""
|
||||||
resp, err := t.Client.Get(u.String())
|
resp, err := t.Client.Get(u.String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
b, err := ioutil.ReadAll(resp.Body)
|
b, err := ioutil.ReadAll(resp.Body)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue