feat(logging); improve messages and errors (#336)

* feat(logger): add module context

* feat(logger): change errors package

* feat(logger): update tests
This commit is contained in:
Ludvig Lundgren 2022-07-05 13:31:44 +02:00 committed by GitHub
parent 95471a4cf7
commit 0e88117702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 1172 additions and 957 deletions

View file

@ -1,9 +1,8 @@
package mock
import (
"fmt"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/errors"
)
type IndexerApiClient interface {
@ -27,7 +26,7 @@ func NewMockClient(url string, apiKey string) IndexerApiClient {
func (c *IndexerClient) GetTorrentByID(torrentID string) (*domain.TorrentBasic, error) {
if torrentID == "" {
return nil, fmt.Errorf("mock client: must have torrentID")
return nil, errors.New("mock client: must have torrentID")
}
r := &domain.TorrentBasic{