Skip to content

Commit

Permalink
Add logging on failure to create file (#3424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Cinader authored and flovilmart committed Jan 30, 2017
1 parent f864141 commit d5940b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Routers/FilesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Middlewares from '../middlewares';
import Parse from 'parse/node';
import Config from '../Config';
import mime from 'mime';
import logger from '../logger';

export class FilesRouter {

Expand Down Expand Up @@ -87,7 +88,8 @@ export class FilesRouter {
res.status(201);
res.set('Location', result.url);
res.json(result);
}).catch(() => {
}).catch((e) => {
logger.error(e.message, e);
next(new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'Could not store file.'));
});
}
Expand Down

0 comments on commit d5940b1

Please sign in to comment.