Исправление "двоения" ErrNotFound x2
This commit is contained in:
10
api.go
10
api.go
@@ -4,9 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gitea.unprism.ru/KRBL/Agate/archive"
|
||||
"gitea.unprism.ru/KRBL/Agate/interfaces"
|
||||
"gitea.unprism.ru/KRBL/Agate/remote"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
@@ -14,6 +11,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"gitea.unprism.ru/KRBL/Agate/archive"
|
||||
"gitea.unprism.ru/KRBL/Agate/interfaces"
|
||||
"gitea.unprism.ru/KRBL/Agate/models"
|
||||
"gitea.unprism.ru/KRBL/Agate/remote"
|
||||
|
||||
"gitea.unprism.ru/KRBL/Agate/store"
|
||||
"gitea.unprism.ru/KRBL/Agate/stores"
|
||||
)
|
||||
@@ -480,7 +482,7 @@ func (ag *Agate) RegisterLocalSnapshot(ctx context.Context, snapshotID, parentID
|
||||
return nil // Snapshot already exists
|
||||
}
|
||||
// We expect ErrNotFound, anything else is a real error.
|
||||
if !errors.Is(err, ErrNotFound) {
|
||||
if !errors.Is(err, models.ErrNotFound) {
|
||||
return fmt.Errorf("failed to check for existing snapshot: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user