You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
386 B

package utils
import "gorm.io/gorm"
func Error(err error) {
if err != nil {
panic(err.Error())
}
}
func DbErrSkipRecordNotFound(err error) {
if err != nil && err != gorm.ErrRecordNotFound {
panic(err.Error())
}
}
func DbErrRecordNotFoundBool(err error) bool {
if err == gorm.ErrRecordNotFound {
return true
} else if err != nil {
panic(err.Error())
}
return false
}