feat(actions): improve errors and logs (#340)

This commit is contained in:
Ludvig Lundgren 2022-07-07 16:28:14 +02:00 committed by GitHub
parent 31fbe013ff
commit 402596523d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 315 additions and 418 deletions

View file

@ -6,10 +6,11 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/lidarr"
)
func (s *service) lidarr(release domain.Release, action domain.Action) ([]string, error) {
func (s *service) lidarr(action domain.Action, release domain.Release) ([]string, error) {
s.log.Trace().Msg("action LIDARR")
// TODO validate data
@ -23,7 +24,7 @@ func (s *service) lidarr(release domain.Release, action domain.Action) ([]string
// return early if no client found
if client == nil {
return nil, err
return nil, errors.New("could not find client by id: %v", action.ClientID)
}
// initial config