Split common error printing into "Error" and message with details

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-06 23:31:09 -04:00
parent 042fde2c79
commit fe469e1154

View File

@ -7,6 +7,8 @@ import (
// CheckError checks if an error occurred (it's not nil)
func CheckError(err error) {
if err != nil {
logrus.Fatal(err.Error())
logrus.WithFields(logrus.Fields{
"message": err.Error(),
}).Fatal("Error")
}
}