Maskf masks the given error with the given format string and arguments (like fmt.Sprintf), returning a new error that maintains the error stack, but hides the underlying error type. The error string still contains the full annotations. If you want to hide the annotations, call Wrap.
(other error, format string, args ...interface{})
| 172 | // hides the underlying error type. The error string still contains the full |
| 173 | // annotations. If you want to hide the annotations, call Wrap. |
| 174 | func Maskf(other error, format string, args ...interface{}) error { |
| 175 | if other == nil { |
| 176 | return nil |
| 177 | } |
| 178 | err := &Err{ |
| 179 | message: fmt.Sprintf(format, args...), |
| 180 | previous: other, |
| 181 | } |
| 182 | err.SetLocation(1) |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | // Mask hides the underlying error type, and records the location of the masking. |
| 187 | func Mask(other error) error { |
searching dependent graphs…