fix(ts): include exit code and stdout fallback in build/generate logs
This commit is contained in:
+12
-4
@@ -66,10 +66,14 @@ function M.build(repo, parser)
|
||||
|
||||
local function on_build(r)
|
||||
if r.code ~= 0 then
|
||||
local detail = r.stderr ~= "" and r.stderr
|
||||
or r.stdout ~= "" and r.stdout
|
||||
or "(no output)"
|
||||
log.error(
|
||||
"Failed to build parser for %s: %s",
|
||||
"Failed to build parser for %s (exit %d): %s",
|
||||
parser.lang,
|
||||
r.stderr or ""
|
||||
r.code,
|
||||
detail
|
||||
)
|
||||
return
|
||||
end
|
||||
@@ -103,10 +107,14 @@ function M.build(repo, parser)
|
||||
},
|
||||
vim.schedule_wrap(function(r)
|
||||
if r.code ~= 0 then
|
||||
local detail = r.stderr ~= "" and r.stderr
|
||||
or r.stdout ~= "" and r.stdout
|
||||
or "(no output)"
|
||||
log.error(
|
||||
"Failed to generate parser for %s: %s",
|
||||
"Failed to generate parser for %s (exit %d): %s",
|
||||
parser.lang,
|
||||
r.stderr or ""
|
||||
r.code,
|
||||
detail
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user