refactor: use v0.4 Error type for error handling
This commit is contained in:
@@ -30,7 +30,7 @@ return {
|
|||||||
if not status or not status.success then
|
if not status or not status.success then
|
||||||
ya.notify {
|
ya.notify {
|
||||||
title = "Chmod",
|
title = "Chmod",
|
||||||
content = string.format("Chmod with selected files failed, exit code %s", status and status.code or err),
|
content = string.format("Chmod on selected files failed, error: %s", status and status.code or err),
|
||||||
level = "error",
|
level = "error",
|
||||||
timeout = 5,
|
timeout = 5,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ local function fetch(_, job)
|
|||||||
:stdout(Command.PIPED)
|
:stdout(Command.PIPED)
|
||||||
:output()
|
:output()
|
||||||
if not output then
|
if not output then
|
||||||
ya.err("Cannot spawn git command, error code " .. tostring(err))
|
ya.err("Cannot spawn git command, error: " .. err)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M:peek(job)
|
function M:peek(job)
|
||||||
local child, code = Command("lsar"):arg(tostring(job.file.url)):stdout(Command.PIPED):spawn()
|
local child, err = Command("lsar"):arg(tostring(job.file.url)):stdout(Command.PIPED):spawn()
|
||||||
if not child then
|
if not child then
|
||||||
return ya.err("spawn `lsar` command returns " .. tostring(code))
|
return ya.err("spawn `lsar` command failed: " .. err)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Skip the first line which is the archive file itself
|
-- Skip the first line which is the archive file itself
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ local function fetch(_, job)
|
|||||||
|
|
||||||
local output, err = Command("tag"):args(paths):stdout(Command.PIPED):output()
|
local output, err = Command("tag"):args(paths):stdout(Command.PIPED):output()
|
||||||
if not output then
|
if not output then
|
||||||
return ya.err("Cannot spawn tag command, error code " .. tostring(err))
|
return ya.err("Cannot spawn tag command, error: " .. err)
|
||||||
end
|
end
|
||||||
|
|
||||||
local i, tags = 1, {}
|
local i, tags = 1, {}
|
||||||
|
|||||||
Reference in New Issue
Block a user