by eadan · 6y ago · 0 comments
if err := foo(x); err != nil {
return fmt.Errorf("foo: bad argument %s", x)
} return fmt.Errorf("ListThings failed: %w", err)
which is a different error type, but the caller can downcast it into the original filesystem error type (even across multiple layers of wrapping) if they're interested in specifically these types of errors.