Remove permissive error handling to expose actual DELETE failures

Co-authored-by: Mord0reK <135718526+Mord0reK@users.noreply.github.com>
pull/878/head
copilot-swe-agent[bot] 2025-11-16 20:22:08 +07:00
parent 8263af0e24
commit 5dd016ad27
1 changed files with 1 additions and 8 deletions

@ -361,14 +361,7 @@ func (widget *vikunjaWidget) removeLabelFromTask(taskID int, labelID int) error
bodyStr := string(body) bodyStr := string(body)
if response.StatusCode < 200 || response.StatusCode >= 300 { if response.StatusCode < 200 || response.StatusCode >= 300 {
// If the label doesn't exist or was already removed, that's fine return fmt.Errorf("DELETE labels status %d: %s", response.StatusCode, bodyStr)
// We want the label off the task, and it is
if response.StatusCode == 404 || response.StatusCode == 400 {
// Label doesn't exist on task, which is the desired state
return nil
}
return fmt.Errorf("DELETE labels unexpected status code %d: %s", response.StatusCode, bodyStr)
} }
// Success - label was removed // Success - label was removed