mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Updated magic link email to use custom status code for failures
refs https://github.com/TryGhost/Team/issues/342 - Send magic link middleware was not using custom status code from error and sending 500 - Updates error code to be picked from err object if present, or fallback to 500 as before otherwise
This commit is contained in:
parent
763153d110
commit
f792148ce8
1 changed files with 2 additions and 1 deletions
|
@ -225,8 +225,9 @@ module.exports = function MembersApi({
|
|||
res.writeHead(201);
|
||||
return res.end('Created.');
|
||||
} catch (err) {
|
||||
const statusCode = (err && err.statusCode) || 500;
|
||||
common.logging.error(err);
|
||||
res.writeHead(500);
|
||||
res.writeHead(statusCode);
|
||||
return res.end('Internal Server Error.');
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue