backends: pass error logger to backends

This commit is contained in:
Michael Eischer
2025-09-14 16:13:21 +02:00
parent 13f743e26b
commit 4dc71f24c5
31 changed files with 96 additions and 96 deletions

View File

@@ -7,10 +7,10 @@ import (
"github.com/restic/restic/internal/backend"
)
func WrapBackendConstructor[B backend.Backend, C any](constructor func(ctx context.Context, cfg C) (B, error)) func(ctx context.Context, cfg C, lim Limiter) (backend.Backend, error) {
return func(ctx context.Context, cfg C, lim Limiter) (backend.Backend, error) {
func WrapBackendConstructor[B backend.Backend, C any](constructor func(ctx context.Context, cfg C, errorLog func(string, ...interface{})) (B, error)) func(ctx context.Context, cfg C, lim Limiter, errorLog func(string, ...interface{})) (backend.Backend, error) {
return func(ctx context.Context, cfg C, lim Limiter, errorLog func(string, ...interface{})) (backend.Backend, error) {
var be backend.Backend
be, err := constructor(ctx, cfg)
be, err := constructor(ctx, cfg, errorLog)
if err != nil {
return nil, err
}