mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
log FS delete errors only on failure
This commit is contained in:
parent
7d96f3aadd
commit
72ebaea5e2
1 changed files with 6 additions and 3 deletions
|
@ -59,13 +59,16 @@ module.exports =
|
|||
filteredName = filterName name
|
||||
logger.log location:location, name:filteredName, "delete file"
|
||||
fs.unlink "#{location}/#{filteredName}", (err) ->
|
||||
logger.err err:err, location:location, name:filteredName, "Error on delete."
|
||||
callback err
|
||||
if err?
|
||||
logger.err err:err, location:location, name:filteredName, "Error on delete."
|
||||
callback err
|
||||
else
|
||||
callback()
|
||||
|
||||
deleteDirectory: (location, name, callback = (err)->)->
|
||||
filteredName = filterName name.replace(/\/$/,'')
|
||||
rimraf "#{location}/#{filteredName}", (err) ->
|
||||
if err
|
||||
if err?
|
||||
logger.err err:err, location:location, name:filteredName, "Error on rimraf rmdir."
|
||||
callback err
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue