Include a custom message if there is an error

This change lets us include a custom message if there is an error
This commit is contained in:
Martin Eskdale Moen 2020-09-07 17:22:24 +01:00
parent fb6ccee193
commit a8926aaab6

View File

@ -7,8 +7,11 @@ import (
"strings"
)
func check(e error) {
func check(e error, optMsg ...string) {
if e != nil {
if (len(optMsg) > 0) {
ExitFail("%s - %s", e, strings.Join(optMsg, " "))
}
ExitFail("%s", e)
}
}