golib/helper/error_helper.go

25 lines
366 B
Go
Raw Normal View History

2023-06-15 21:22:51 +08:00
//
// error_helper.go
// Copyright (C) 2022 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package helper
import "github.com/pkg/errors"
2023-06-15 21:22:51 +08:00
func CheckErr(err error) {
if err != nil {
panic(err)
}
}
func Error(msg string) error {
return errors.New(msg)
}
func WrapErr(err error, msg string) error {
return errors.Wrap(err, msg)
}