From e00d211619c437d1cbe920d7f08cbc558ef71c56 Mon Sep 17 00:00:00 2001 From: Oliver Eiber Date: Sun, 6 Jul 2025 22:33:25 +0200 Subject: [PATCH] ensure that doorbird errors where shown in logs --- pkg/doorbird/backchannel.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/doorbird/backchannel.go b/pkg/doorbird/backchannel.go index 82ea31b4..d338a445 100644 --- a/pkg/doorbird/backchannel.go +++ b/pkg/doorbird/backchannel.go @@ -2,6 +2,7 @@ package doorbird import ( "bufio" + "errors" "fmt" "net" "net/url" @@ -64,11 +65,11 @@ func Dial(rawURL string) (*Client, error) { if err == nil { if statusCode == 204 { conn.Close() - return nil, fmt.Errorf("DoorBird user has no api permission: %d", statusCode) + return nil, errors.New("DoorBird user has no api permission") } if statusCode == 503 { conn.Close() - return nil, fmt.Errorf("DoorBird device is busy: %d", statusCode) + return nil, errors.New("DoorBird device is busy") } } } @@ -104,7 +105,7 @@ func (c *Client) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, func (c *Client) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error { if len(c.Senders) > 0 { - return fmt.Errorf("DoorBird backchannel already in use") + return errors.New("DoorBird backchannel already in use") } sender := core.NewSender(media, track.Codec)