Mask hides the underlying error type, and records the location of the masking.
(other error)
| 185 | |
| 186 | // Mask hides the underlying error type, and records the location of the masking. |
| 187 | func Mask(other error) error { |
| 188 | if other == nil { |
| 189 | return nil |
| 190 | } |
| 191 | err := &Err{ |
| 192 | previous: other, |
| 193 | } |
| 194 | err.SetLocation(1) |
| 195 | return err |
| 196 | } |
| 197 | |
| 198 | // Cause returns the cause of the given error. This will be either the |
| 199 | // original error, or the result of a Wrap or Mask call. |
searching dependent graphs…