psu/common/errors.go

15 lines
248 B
Go
Raw Normal View History

package common
import (
"github.com/sirupsen/logrus"
)
// CheckError checks if an error occurred (it's not nil)
func CheckError(err error) {
if err != nil {
logrus.WithFields(logrus.Fields{
"message": err.Error(),
2019-08-10 22:28:00 +00:00
}).Fatal("error")
}
}