Skip to content

Commit

Permalink
moved logging responsibility to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
jagaimoworks committed Nov 29, 2024
1 parent a1e7f12 commit 25fd6ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/portforward/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"fmt"
"net/http"
"sync"
)
Expand Down Expand Up @@ -55,8 +56,7 @@ func (s *Service) SetPortsForwarded(ctx context.Context, ports []uint16) (err er
for j := range i {
_ = s.portAllower.SetAllowedPort(ctx, s.ports[j], s.settings.Interface)
}
s.logger.Error(err.Error())
return err
return fmt.Errorf("removing allowed port: %w", err)
}
}

Expand All @@ -69,8 +69,7 @@ func (s *Service) SetPortsForwarded(ctx context.Context, ports []uint16) (err er
for _, port := range s.ports {
_ = s.portAllower.SetAllowedPort(ctx, port, s.settings.Interface)
}
s.logger.Error(err.Error())
return err
return fmt.Errorf("setting allowed port: %w", err)
}
}

Expand Down

0 comments on commit 25fd6ff

Please sign in to comment.