fix: propagate errors in recursive_delete and recursive_copy (#712)
The `complete` callback checks `err` instead of `err2`, but `err` is always nil inside the `elseif entries` branch. This silently ignores child operation errors, causing misleading "directory not empty" failures.
This commit is contained in:
parent
43227c5a1c
commit
d278dc40f9
1 changed files with 2 additions and 2 deletions
|
|
@ -218,7 +218,7 @@ M.recursive_delete = function(entry_type, path, cb)
|
||||||
local waiting = #entries
|
local waiting = #entries
|
||||||
local complete
|
local complete
|
||||||
complete = function(err2)
|
complete = function(err2)
|
||||||
if err then
|
if err2 then
|
||||||
complete = function() end
|
complete = function() end
|
||||||
return inner_cb(err2)
|
return inner_cb(err2)
|
||||||
end
|
end
|
||||||
|
|
@ -320,7 +320,7 @@ M.recursive_copy = function(entry_type, src_path, dest_path, cb)
|
||||||
local waiting = #entries
|
local waiting = #entries
|
||||||
local complete
|
local complete
|
||||||
complete = function(err2)
|
complete = function(err2)
|
||||||
if err then
|
if err2 then
|
||||||
complete = function() end
|
complete = function() end
|
||||||
return inner_cb(err2)
|
return inner_cb(err2)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue