psu/common/customerrors.go

14 lines
203 B
Go
Raw Normal View History

2019-07-21 02:00:04 +00:00
package common
import (
2019-07-24 02:43:23 +00:00
"fmt"
2019-07-21 02:00:04 +00:00
"log"
)
// CheckError checks if an error occurred (it's not nil)
func CheckError(err error) {
if err != nil {
2019-07-24 02:43:23 +00:00
log.Fatalln(fmt.Sprintf("Error: %s", err.Error()))
2019-07-21 02:00:04 +00:00
}
}