Skip to content

Commit

Permalink
fix(streams): remove uv.errno usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Jun 9, 2024
1 parent 6320241 commit ef1837e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/nio/streams.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function nio.streams._writer(input)
write = function(data)
local maybe_err = uv.write(pipe, data)
if type(maybe_err) == "string" then
return vim.loop.translate_sys_error(vim.loop.errno[maybe_err])
return maybe_err
end
return nil
end,
Expand Down
2 changes: 1 addition & 1 deletion tests/file_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("file", function()

local err = file.write("hello")

assert.equal("EBADF: bad file descriptor", err)
assert.equal("EBADF", err)
end)

a.it("reads file", function()
Expand Down

0 comments on commit ef1837e

Please sign in to comment.