Init commit
This commit is contained in:
16
lib/e/e.go
Normal file
16
lib/e/e.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package e
|
||||
|
||||
import "fmt"
|
||||
|
||||
func Wrap(msg string, err error) error {
|
||||
|
||||
return fmt.Errorf("%s: %w", msg, err)
|
||||
}
|
||||
|
||||
func WrapIfErr(msg string, err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return Wrap(msg, err)
|
||||
}
|
||||
Reference in New Issue
Block a user