Log errors from cmd.FailOnError

This commit is contained in:
Roland Shoemaker 2015-08-31 18:47:16 -07:00
parent 79a3be6c5c
commit 3cce4117fa
1 changed files with 4 additions and 0 deletions

View File

@ -37,8 +37,10 @@ import (
"github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/cactus/go-statsd-client/statsd"
"github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/codegangsta/cli"
"github.com/letsencrypt/boulder/ca"
"github.com/letsencrypt/boulder/core"
blog "github.com/letsencrypt/boulder/log"
)
// Config stores configuration parameters that applications
@ -270,6 +272,8 @@ func (as *AppShell) VersionString() string {
func FailOnError(err error, msg string) {
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
logger := blog.GetAuditLogger()
logger.Err(fmt.Sprintf("%s: %s", msg, err))
fmt.Fprintf(os.Stderr, "%s: %s\n", msg, err)
os.Exit(1)
}