Modernize error handling in local backend

* Stop prepending the operation name: it's already part of os.PathError,
  leading to repetitive errors like "Chmod: chmod /foo/bar: operation not
  permitted".

* Use errors.Is to check for specific errors.
This commit is contained in:
greatroar
2021-06-07 19:26:25 +02:00
parent d7322a5f36
commit e5f0f67ba0
2 changed files with 13 additions and 11 deletions

View File

@@ -27,6 +27,8 @@ var Wrapf = errors.Wrapf
// returns nil.
var WithMessage = errors.WithMessage
var WithStack = errors.WithStack
// Cause returns the cause of an error. It will also unwrap certain errors,
// e.g. *url.Error returned by the net/http client.
func Cause(err error) error {