mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 21:23:12 +01:00
The plugin now returns a 404 status code when a requested WAL file does not exist in the object store. This prevents misleading log entries such as "Error while handling gRPC request" for expected missing-file scenarios. Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
15 lines
414 B
Go
15 lines
414 B
Go
package common
|
|
|
|
import (
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
// newWALNotFoundError returns a error that states that a
|
|
// certain WAL file has not been found. This error is
|
|
// compatible with GRPC status codes, resulting in a 404
|
|
// being used as a response code.
|
|
func newWALNotFoundError(walName string) error {
|
|
return status.Errorf(codes.NotFound, "wal %q not found", walName)
|
|
}
|