Fail with detailed message on envvar parse error (#907)

Ref #829
This commit is contained in:
Yusuke Kuoka
2021-11-03 10:24:24 +09:00
committed by GitHub
parent 46da4a6b6e
commit b6c33cee32

View File

@@ -82,7 +82,8 @@ func main() {
var c github.Config
err = envconfig.Process("github", &c)
if err != nil {
fmt.Fprintln(os.Stderr, "Error: Environment variable read failed.")
fmt.Fprintf(os.Stderr, "Error: processing environment variables: %v\n", err)
os.Exit(1)
}
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")