fix: checking for error types

This commit is contained in:
kolaente 2022-03-27 17:52:33 +02:00
parent 5cf263a86f
commit ac6818a476
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
2 changed files with 4 additions and 2 deletions

View file

@ -137,7 +137,8 @@ func (f *File) Delete() (err error) {
err = afs.Remove(f.getFileName())
if err != nil {
if errors.Is(err, &os.PathError{}) {
var perr *os.PathError
if errors.As(err, &perr) {
// Don't fail when removing the file failed
log.Errorf("Error deleting file %d: %w", err)
return s.Commit()