Skip to content

Commit d0f785c

Browse files
committed
Handle errors in proxy responses
1 parent 7ce6a4a commit d0f785c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ func handleRequest(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http
227227
fmt.Printf("UNHANDLED GAMEZIP ERROR: %s\n", err)
228228
}
229229
proxyReq.Header = gamezipRequest.Header
230-
proxyResp, err := client.Do(proxyReq)
231230

231+
proxyResp, err := client.Do(proxyReq)
232+
if err != nil {
233+
fmt.Printf("UNHANDLED GAMEZIP SERVER ERROR: %s\n", err)
234+
}
232235
if proxyResp.StatusCode >= 500 {
233236
fmt.Println("Gamezip Server Error: ", proxyResp.StatusCode)
234237
}

0 commit comments

Comments
 (0)