From 8d65f93fa431a55bdd418dbe67338410022cbdb8 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 2 Jun 2016 14:40:29 -0700 Subject: [PATCH] return error.message --- src/routes/mailboxes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/mailboxes.js b/src/routes/mailboxes.js index ed6464319..a2d2bc2c6 100644 --- a/src/routes/mailboxes.js +++ b/src/routes/mailboxes.js @@ -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));