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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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.")