Исправление "двоения" ErrNotFound x2
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
agate "gitea.unprism.ru/KRBL/Agate"
|
||||
"gitea.unprism.ru/KRBL/Agate/models"
|
||||
"gitea.unprism.ru/KRBL/Agate/store"
|
||||
)
|
||||
|
||||
@@ -76,7 +76,7 @@ func (fs *fileSystemStore) RetrieveBlob(ctx context.Context, snapshotID string)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
// Если файл не найден, возвращаем кастомную ошибку
|
||||
return nil, agate.ErrNotFound
|
||||
return nil, models.ErrNotFound
|
||||
}
|
||||
return nil, fmt.Errorf("failed to open blob file %s: %w", blobPath, err)
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func (fs *fileSystemStore) GetBlobPath(ctx context.Context, snapshotID string) (
|
||||
// Проверяем существование файла
|
||||
if _, err := os.Stat(blobPath); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return "", agate.ErrNotFound
|
||||
return "", models.ErrNotFound
|
||||
}
|
||||
return "", fmt.Errorf("failed to stat blob file %s: %w", blobPath, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user