feat: better error handling

This commit is contained in:
sxyazi
2025-01-28 03:45:54 +08:00
parent 8ed253716c
commit f202fa8969
4 changed files with 35 additions and 11 deletions

View File

@@ -43,7 +43,11 @@ local function fetch(_, job)
local output, err = Command("tag"):args(paths):stdout(Command.PIPED):output()
if not output then
return ya.err("Cannot spawn tag command, error: " .. err)
if not ya.__250127 then -- TODO: remove this
ya.err("Cannot spawn tag command, error: " .. err)
return 0
end
return true, Err("Cannot spawn `tag` command, error: %s", err)
end
local i, tags = 1, {}
@@ -61,7 +65,10 @@ local function fetch(_, job)
end
update(tags)
return 1
if not ya.__250127 then -- TODO: remove this
return 1
end
return true
end
local cands = ya.sync(function(st)