0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Fixed passing error to IncorrectUsageError

- we should pass it as `err` and not `error`
- this probably slipped in because the catch parameter is called
  `error`, so I've updated that and fixed the references
This commit is contained in:
Daniel Lockyer 2024-05-06 21:19:10 +02:00 committed by Daniel Lockyer
parent efc59dd315
commit b29c897da3

View file

@ -47,16 +47,15 @@ module.exports = function adminController(req, res) {
}
res.sendFile(templatePath, {headers});
} catch (error) {
if (error.code === 'ENOENT') {
} catch (err) {
if (err.code === 'ENOENT') {
throw new errors.IncorrectUsageError({
message: tpl(messages.templateError.message, {templatePath}),
context: tpl(messages.templateError.context),
help: tpl(messages.templateError.help, {link: 'https://ghost.org/docs/install/source/'}),
error: error
err
});
} else {
throw error;
}
throw err;
}
};