This commit is contained in:
2023-08-08 18:01:00 +02:00
parent e10140e143
commit ac416f7b69
2 changed files with 6 additions and 2 deletions

View File

@@ -80,6 +80,10 @@ func New(t ErrorType, msg string) *Builder {
}
func Wrap(err error, msg string) *Builder {
if err == nil {
return &Builder{errorData: newExErr(CatSystem, TypeInternal, msg)} // prevent NPE if we call Wrap with err==nil
}
if !pkgconfig.RecursiveErrors {
v := FromError(err)
v.Message = msg