mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03: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
@ -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…
Reference in New Issue
Block a user