Correctly detect os.IsNotExist error; ref pterodactyl/panel#2438
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user