mirror of https://github.com/goproxyio/goproxy
log error detail
parent
6ea355b5b9
commit
4a2c1bd262
3
main.go
3
main.go
|
@ -103,6 +103,7 @@ func goGet(path, version, suffix string, w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
|
||||
if err := cmd.Wait(); err != nil {
|
||||
fmt.Fprintf(os.Stdout, "goproxy: download %s stdout: %s stderr: %s\n", path, string(bytesOut), string(bytesErr))
|
||||
return err
|
||||
}
|
||||
out := fmt.Sprintf("%s", bytesErr)
|
||||
|
@ -124,7 +125,5 @@ func goGet(path, version, suffix string, w http.ResponseWriter, r *http.Request)
|
|||
http.Redirect(w, r, url, 302)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stdout, "goproxy: download %s stdout: %s stderr: %s\n", path, string(bytesOut), string(bytesErr))
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -3,12 +3,10 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func ReturnServerError(w http.ResponseWriter, err error) {
|
||||
w.WriteHeader(500)
|
||||
msg := fmt.Sprintf("%v", err)
|
||||
w.Write([]byte(msg))
|
||||
fmt.Fprintf(os.Stderr, "goproxy: %v\n", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue