return error.message

This commit is contained in:
Girish Ramakrishnan
2016-06-02 14:40:29 -07:00
parent 462440bb30
commit 8d65f93fa4
+1 -1
View File
@@ -71,7 +71,7 @@ function setAliases(req, res, next) {
mailboxes.setAliases(req.params.mailboxId, req.body.aliases, function (error) {
if (error && error.reason === MailboxError.NOT_FOUND) return next(new HttpError(404, 'No such mailbox'));
if (error && error.reason === MailboxError.BAD_FIELD) return next(new HttpError(400, error.reason));
if (error && error.reason === MailboxError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error && error.reason === MailboxError.ALREADY_EXISTS) return next(new HttpError(409, 'One or more alias already exist'));
if (error) return next(new HttpError(500, error));