Correctly detect os.IsNotExist error; ref pterodactyl/panel#2438
This commit is contained in:
parent
6bc8b1a567
commit
d9109cbf5a
|
@ -99,7 +99,7 @@ func (a *Archiver) Archive() error {
|
||||||
// DeleteIfExists deletes the archive if it exists.
|
// DeleteIfExists deletes the archive if it exists.
|
||||||
func (a *Archiver) DeleteIfExists() error {
|
func (a *Archiver) DeleteIfExists() error {
|
||||||
stat, err := a.Stat()
|
stat, err := a.Stat()
|
||||||
if err != nil && !os.IsNotExist(err) {
|
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user