fix(sentry): skip "daemon not running" stop/reload errors

This commit is contained in:
Deivid Soto 2026-05-27 16:50:16 +02:00
parent fceadd2009
commit 4d7444ef5b
6 changed files with 90 additions and 12 deletions

View file

@ -1,6 +1,11 @@
package sentry
import "testing"
import (
"fmt"
"testing"
"github.com/torrentclaw/unarr/internal/agent"
)
func TestEnvironment(t *testing.T) {
tests := []struct {
@ -45,3 +50,13 @@ func TestSetUser(t *testing.T) {
// Should not panic without initialization
SetUser("agent-123")
}
func TestIsUserInputErrorDaemonNotRunning(t *testing.T) {
if !isUserInputError(agent.ErrDaemonNotRunning) {
t.Error("ErrDaemonNotRunning should be treated as user-input error")
}
wrapped := fmt.Errorf("stop daemon: %w", agent.ErrDaemonNotRunning)
if !isUserInputError(wrapped) {
t.Error("wrapped ErrDaemonNotRunning should be treated as user-input error")
}
}