File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
2525 "os"
2626 "time"
2727
28+ "github.com/cortexlabs/cortex/pkg/lib/debug"
2829 "github.com/cortexlabs/cortex/pkg/lib/files"
2930)
3031
@@ -100,13 +101,18 @@ func makeRequestLoop(url string, jsonBytes []byte) {
100101 response , _ , err := makeRequest (url , jsonBytes )
101102
102103 if err != nil {
103- fmt .Print (err . Error ( ))
104+ fmt .Print (" \n " + debug . Sppg ( err ))
104105 continue
105106 }
106107
107108 if response .StatusCode != 200 {
108- fmt .Print (response .StatusCode )
109- fmt .Print (" " )
109+ bodyBytes , err := ioutil .ReadAll (response .Body )
110+ response .Body .Close ()
111+ if err == nil {
112+ fmt .Printf ("\n status code: %d; body: %s\n " , response .StatusCode , string (bodyBytes ))
113+ } else {
114+ fmt .Printf ("\n status code: %d; error reading body: %s\n " , response .StatusCode , string (err .Error ()))
115+ }
110116 continue
111117 }
112118
You can’t perform that action at this time.
0 commit comments