errors: Drop Cause in favor of Go 1.13 error handling

The only use cases in the code were in errors.IsFatal, backend/b2,
which needs a workaround, and backend.ParseLayout. The last of these
requires all backends to implement error unwrapping in IsNotExist.
All backends except gs already did that.
This commit is contained in:
greatroar
2022-10-08 12:37:18 +02:00
parent 83cb58b4f3
commit 07e5c38361
7 changed files with 34 additions and 58 deletions

View File

@@ -174,13 +174,8 @@ func (be *Backend) IsNotExist(err error) bool {
return true
}
if er, ok := err.(*googleapi.Error); ok {
if er.Code == 404 {
return true
}
}
return false
var gerr *googleapi.Error
return errors.As(err, &gerr) && gerr.Code == 404
}
// Join combines path components with slashes.