mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
backends: pass error logger to backends
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user