Skip to content
Snippets Groups Projects
Commit 2bee595b authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Try catch ao deletar os arquivos

parent 13c62a18
No related branches found
No related tags found
1 merge request!1Reimplementação em NodeJS
......@@ -24,14 +24,19 @@ Arquivo.remove({}, function(err) {
} catch(e) {
log.error(e)
}
if(files.length > 0) {
for(var i = 0; i < files.length; i++) {
var filePath = dir + files[i]
if(fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath)
try {
if(files.length > 0) {
for(var i = 0; i < files.length; i++) {
var filePath = dir + files[i]
if(fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath)
}
}
}
}
} catch(e) {
log.error(e)
}
})
Materia.remove({}, function(err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment