Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
handle file open error
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jan 30, 2022
1 parent 4a03611 commit c262655
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apiclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ func PostHttpZip(print bool, auth bool, method string, url string, headers map[s

//PostHttpOctet method is used to send resources, proxy bundles, shared flows etc.
func PostHttpOctet(print bool, update bool, url string, proxyName string) (respBody []byte, err error) {
file, _ := os.Open(proxyName)
file, err := os.Open(proxyName)
if err != nil {
clilog.Error.Printf("failed to open the file %s with error: %v", proxyName, err)
return nil, err
}
defer file.Close()

var req *http.Request
Expand Down

0 comments on commit c262655

Please sign in to comment.