mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add error handling to mkdir_p
This commit is contained in:
parent
ece0491e3d
commit
c653f59705
1 changed files with 2 additions and 0 deletions
|
@ -258,6 +258,7 @@ module.exports = ProjectEntityHandler =
|
|||
if !foundFolder?
|
||||
logger.log path:path, project_id:project._id, folderName:folderName, "making folder from mkdirp"
|
||||
@addFolder project_id, parentFolder_id, folderName, (err, newFolder, parentFolder_id)->
|
||||
return callback(err) if err?
|
||||
newFolder.parentFolder_id = parentFolder_id
|
||||
previousFolders.push newFolder
|
||||
callback null, previousFolders
|
||||
|
@ -268,6 +269,7 @@ module.exports = ProjectEntityHandler =
|
|||
|
||||
|
||||
async.reduce folders, [], procesFolder, (err, folders)->
|
||||
return callback(err) if err?
|
||||
lastFolder = folders[folders.length-1]
|
||||
folders = _.select folders, (folder)->
|
||||
!folder.filterOut
|
||||
|
|
Loading…
Reference in a new issue