mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed invalid filename error during settings restore
refs https://github.com/TryGhost/Toolbox/issues/151
refs cbec6aa49e
- The error was happening due to incorrect "this" context. Because the filename and extension are only used once in this class and only for the purposes of the error message have moved the whole thing into the error message itself. No need to keep additional variables around when there's no clear usecase.
This commit is contained in:
parent
18b8eddd0d
commit
e6503e5148
1 changed files with 2 additions and 10 deletions
|
@ -9,7 +9,7 @@ const tpl = require('@tryghost/tpl');
|
|||
const bridge = require('../../../bridge');
|
||||
|
||||
const messages = {
|
||||
loadError: 'Could not load {filename} file.'
|
||||
loadError: 'Could not load routes.yaml file.'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -38,14 +38,6 @@ class RouteSettings {
|
|||
* @private
|
||||
*/
|
||||
this.defaultRoutesSettingHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
this.filename = 'routes';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
this.ext = 'yaml';
|
||||
|
||||
this.settingsLoader = settingsLoader;
|
||||
this.settingsPath = settingsPath;
|
||||
|
@ -134,7 +126,7 @@ class RouteSettings {
|
|||
if (!urlService.hasFinished()) {
|
||||
if (tries > 5) {
|
||||
throw new errors.InternalServerError({
|
||||
message: tpl(messages.loadError, {filename: `${this.filename}.${this.ext}`})
|
||||
message: tpl(messages.loadError)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue