mirror of
https://github.com/restic/restic.git
synced 2025-10-09 07:33:53 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user