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:
parent
efc59dd315
commit
b29c897da3
1 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue