summaryrefslogtreecommitdiff
path: root/internal/cli/timer.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-03 23:43:48 +0200
committerPaul Buetow <paul@buetow.org>2026-03-03 23:43:48 +0200
commit7e6b2e4c2ba957899b12dac7e0ea9f7c29a9a7b3 (patch)
tree40ddb216b080bd0da08502bd855c25d45f9dc4cd /internal/cli/timer.go
parent293406c3bd2acc85490da11afabaf6733babd5e4 (diff)
worktime: use sentinel login state errors
Replace string matching in timer sync with errors.Is and add regression tests.
Diffstat (limited to 'internal/cli/timer.go')
-rw-r--r--internal/cli/timer.go2
1 files changed, 1 insertions, 1 deletions
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
}