Skip to content

Commit 702d795

Browse files
committed
feat: some tuning to error messages and nil checks
1 parent 9ee059b commit 702d795

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lua/nurl/actions.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ M.builtin = {
114114
cancel = function(_)
115115
return function()
116116
local curl = vim.b.nurl_curl
117-
local pid = curl.pid
118117

119-
if pid ~= nil then
120-
local code, msg = uv.kill(pid, "sigterm")
118+
if curl and curl.pid then
119+
local code, msg = uv.kill(curl.pid, "sigterm")
121120
if code ~= 0 then
122121
vim.notify(
123122
"Could not kill curl: " .. msg,

lua/nurl/environments.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ local function create_coroutine()
5656
return coroutine.create(function()
5757
while true do
5858
if M.project_env_file == nil then
59-
error("Environment file wasn't loaded. Stopping worker...")
59+
error("Environment file wasn't loaded. Worker stopped.")
6060
end
6161

6262
while #operations_queue == 0 do

lua/nurl/requests.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function M.expand(request, opts)
7373
assert(
7474
(request[1] and not request.url and type(request[1]) == "string")
7575
or (request.url and not request[1]),
76-
"The request must have one and only one URL field"
76+
"The request must have one and at most one URL field"
7777
)
7878

7979
local super_url

0 commit comments

Comments
 (0)