Skip to content

Commit

Permalink
feat: show error message on qflist
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Oct 31, 2023
1 parent dc7c2d7 commit 5d977a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/hurl/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ local function request(opts, callback)
is_running = false
if code ~= 0 then
-- Send error code and response to quickfix and open it
vim.fn.setqflist({ { filename = vim.inspect(cmd), text = vim.inspect(response.body) } })
-- It should display the error message
vim.fn.setqflist({}, 'r', {
title = 'hurl',
lines = response.raw or response.body,
})
vim.fn.setqflist({}, 'a', {
title = 'hurl',
lines = { response.headers_str },
})
vim.cmd('copen')
return
end
Expand Down

0 comments on commit 5d977a2

Please sign in to comment.