|
@@ -89,7 +89,7 @@ func Pv(src io.Reader, info io.Writer) io.Reader {
|
|
|
// the body of the response. If `stderr` is not nil, a progress bar will be
|
|
|
// written to it.
|
|
|
func Curl(url string, stderr io.Writer) (io.Reader, error) {
|
|
|
- curl := exec.Command("curl", "-#", "-L", url)
|
|
|
+ curl := exec.Command("curl", "-#", "-L", "--fail", url)
|
|
|
output, err := curl.StdoutPipe()
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
@@ -98,5 +98,8 @@ func Curl(url string, stderr io.Writer) (io.Reader, error) {
|
|
|
if err := curl.Start(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ if err := curl.Wait(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
return output, nil
|
|
|
}
|