Skip to content

Commit e9ba136

Browse files
authored
Add error for status code
1 parent 7c731b8 commit e9ba136

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/request.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ func fileTransferRequest(c CatalogEntry, tr *TransferRequest) (*http.Response, e
9999
req.Header.Set("Dst", tr.DstAlias)
100100
client := utils.HttpClient()
101101
resp, err = client.Do(req)
102-
if err != nil || resp.StatusCode != 200 {
102+
if err != nil {
103103
done <- err
104104
return
105105
}
106+
if resp.StatusCode != 200 {
107+
done <- errors.New("Status Code is not 200")
108+
return
109+
}
106110
done <- nil
107111
}()
108112
part, err := writer.CreateFormFile("data", filepath.Base(c.Pfn))

0 commit comments

Comments
 (0)