Skip to content

Commit

Permalink
Log response body as well on parse failure
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Oct 30, 2024
1 parent 07a6dd6 commit 59068ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/CopilotChat/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function Copilot:ask(prompt, opts)
})

if not ok then
err = 'Failed parse response: \n' .. line .. '\n' .. vim.inspect(content)
err = 'Failed to parse response: ' .. vim.inspect(content) .. '\n' .. line
log.error(err)
return
end
Expand Down Expand Up @@ -581,7 +581,7 @@ function Copilot:ask(prompt, opts)
})

if not ok then
local err = 'Failed parse response: ' .. vim.inspect(content)
local err = 'Failed to parse response: ' .. vim.inspect(content) .. '\n' .. response.body
log.error(err)
if on_error then
on_error(err)
Expand Down Expand Up @@ -748,7 +748,7 @@ function Copilot:embed(inputs, opts)

if not ok then
local err = vim.inspect(content)
log.error('Failed parse response: ' .. err)
log.error('Failed to parse response: ' .. err .. '\n' .. response.body)
resolve()
return
end
Expand Down

0 comments on commit 59068ae

Please sign in to comment.