From 7e6b2e4c2ba957899b12dac7e0ea9f7c29a9a7b3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 3 Mar 2026 23:43:48 +0200 Subject: worktime: use sentinel login state errors Replace string matching in timer sync with errors.Is and add regression tests. --- internal/cli/timer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/cli/timer.go') diff --git a/internal/cli/timer.go b/internal/cli/timer.go index 78d6d8d..46292ad 100644 --- a/internal/cli/timer.go +++ b/internal/cli/timer.go @@ -242,7 +242,7 @@ func syncWorktimeWithTimer(start bool) error { } // Avoid failing timer commands on no-op state sync mismatches. - if strings.Contains(err.Error(), "already logged in") || strings.Contains(err.Error(), "not logged in") { + if errors.Is(err, worktime.ErrAlreadyLoggedIn) || errors.Is(err, worktime.ErrNotLoggedIn) { return nil } -- cgit v1.2.3