Исправление "двоения" ErrNotFound

This commit is contained in:
2025-10-30 01:50:32 +03:00
parent cd98d1f4a2
commit 644a94656a
4 changed files with 7 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
agate "gitea.unprism.ru/KRBL/Agate"
"gitea.unprism.ru/KRBL/Agate/store"
_ "github.com/mattn/go-sqlite3"
"os"
@@ -130,7 +131,7 @@ func (s *sqliteStore) GetSnapshotMetadata(ctx context.Context, snapshotID string
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
// Если запись не найдена, возвращаем кастомную ошибку
return nil, store.ErrNotFound
return nil, agate.ErrNotFound
}
return nil, fmt.Errorf("failed to query snapshot %s: %w", snapshotID, err)
}