mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
ac07703f17
- getting rid of instances of new Error as we should always use @tryghost/errors
- Whilst here, got rid of i18n but discovered the messages were missing!
- This is my fault, they disappeared when I removed external apps and clearly removed too much: 8c1a0b8d0c (diff-0f5cc40aa8906a1be1bad2002a35361bbf9e766e46b3b29be10f4f479265426a)
- Therefore, I have restored these messages in the places where they were used, except amp_content, where I have written a new message, as the message that was there was not relevant
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
const debug = require('@tryghost/debug')('services:apps');
|
|
const Promise = require('bluebird');
|
|
const tpl = require('@tryghost/tpl');
|
|
const logging = require('@tryghost/logging');
|
|
const errors = require('@tryghost/errors');
|
|
const config = require('../../../shared/config');
|
|
const loader = require('./loader');
|
|
|
|
const messages = {
|
|
appWillNotBeLoadedError: 'The app will not be loaded',
|
|
appWillNotBeLoadedHelp: 'Check with the app creator, or read the app documentation for more details on app requirements'
|
|
};
|
|
|
|
module.exports = {
|
|
init: function () {
|
|
debug('init begin');
|
|
const appsToLoad = config.get('apps:internal');
|
|
|
|
return Promise.map(appsToLoad, appName => loader.activateAppByName(appName))
|
|
.catch(function (err) {
|
|
logging.error(new errors.GhostError({
|
|
err: err,
|
|
context: tpl(messages.appWillNotBeLoadedError),
|
|
help: tpl(messages.appWillNotBeLoadedHelp)
|
|
}));
|
|
});
|
|
}
|
|
};
|