summaryrefslogtreecommitdiff
path: root/cmd/util/exit.go
blob: 8871a483cdc8c1c35acfc0e328a1ecdd0ed0255b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package util

import (
	"os"
)

// ExitWithError prints error and exits with error code`.
func ExitWithError(err error) {
	errP := Panicf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
	if errP != nil {
		// in case of error during Panicf, print this error via build-int print function
		println("error occurred during fmt.Fprint: " + err.Error())
	}
	os.Exit(1)
}