diff --git a/go.sum b/go.sum index 3eab5be..e5e4e58 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,6 @@ github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241113134512-8608232c2813 h github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241113134512-8608232c2813/go.mod h1:f4hObdRVoQtMmVtWqZ6VDZBrI6ok9Td/UMhojQ+EPmk= github.com/cloudnative-pg/cnpg-i v0.0.0-20241109002750-8abd359df734 h1:4jq/FUrlAKxu0Kw9PL5lj5Njq8pAnmUpP/kXKOrJAaE= github.com/cloudnative-pg/cnpg-i v0.0.0-20241109002750-8abd359df734/go.mod h1:3U7miYasKr2rYCQzrn/IvbSQc0OpYF8ieZt2FKG4nv0= -github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241129144432-bd94f16685d3 h1:hKTlmgyOq5ZS7t1eVa4SY1hH361gZ7VIb0an+BH9rJs= -github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241129144432-bd94f16685d3/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY= github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241205093641-958e207b8afe h1:gUGqx4eTHreM0QWbszSx6wnbBw9Vavp5uYl4uA9fh1k= github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241205093641-958e207b8afe/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY= github.com/cloudnative-pg/machinery v0.0.0-20241105070525-042a028b767c h1:t0RBU2gBiwJQ9XGeXlHPBYpsTscSKHgB5TfcWaiwanc= diff --git a/internal/cnpgi/common/errors.go b/internal/cnpgi/common/errors.go index 53ce085..48b2cde 100644 --- a/internal/cnpgi/common/errors.go +++ b/internal/cnpgi/common/errors.go @@ -1,14 +1,16 @@ package common -// WALNotFoundError is raised when a WAL file has not been found in the object store -type WALNotFoundError struct{} +// walNotFoundError is raised when a WAL file has not been found in the object store +type walNotFoundError struct{} + +func newWALNotFoundError() *walNotFoundError { return &walNotFoundError{} } // ShouldPrintStackTrace tells whether the sidecar log stream should contain the stack trace -func (e WALNotFoundError) ShouldPrintStackTrace() bool { +func (e walNotFoundError) ShouldPrintStackTrace() bool { return false } // Error implements the error interface -func (e WALNotFoundError) Error() string { +func (e walNotFoundError) Error() string { return "WAL file not found" } diff --git a/internal/cnpgi/common/wal.go b/internal/cnpgi/common/wal.go index 124b5cf..ef32172 100644 --- a/internal/cnpgi/common/wal.go +++ b/internal/cnpgi/common/wal.go @@ -247,7 +247,7 @@ func (w WALServiceImplementation) restoreFromBarmanObjectStore( // The failure has already been logged in walRestorer.RestoreList method if walStatus[0].Err != nil { if errors.Is(walStatus[0].Err, barmanRestorer.ErrWALNotFound) { - return WALNotFoundError{} + return newWALNotFoundError() } return walStatus[0].Err