From 9f74450196d523aa311ae2afbcca20fda1246b9b Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 29 Aug 2015 22:51:33 -0400 Subject: [PATCH] log unlink error --- src/controllers/accounts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 4a7b3ef390..ba50f9b49e 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -6,6 +6,7 @@ var fs = require('fs'), nconf = require('nconf'), async = require('async'), validator = require('validator'), + winston = require('winston'), db = require('../database'), user = require('../user'), @@ -484,7 +485,9 @@ accountsController.uploadPicture = function (req, res, next) { user.uploadPicture(updateUid, userPhoto, next); } ], function(err, image) { - fs.unlink(userPhoto.path); + fs.unlink(userPhoto.path, function(err) { + winston.error('unabled to delete picture', err); + }); if (err) { return next(err); }