mirror of
https://github.com/strapi/strapi.git
synced 2025-10-06 13:52:13 +00:00
Fix silent fail log files
This commit is contained in:
parent
996decce0a
commit
d0a9d3ab2f
@ -68,7 +68,12 @@ module.exports = {
|
||||
|
||||
if (env && _.isEmpty(_.find(Service.getEnvironments(), { name: env }))) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.environment.unknown' }] }]);
|
||||
|
||||
const model = _.has(Service, slug) ? Service[slug](env) : return ctx.badRequest(null, [{ messages: [{ id: 'request.error.config' }] }]);;
|
||||
let model;
|
||||
if (_.has(Service, slug)) {
|
||||
model = Service[slug](env);
|
||||
} else {
|
||||
return ctx.badRequest(null, [{ messages: [{ id: 'request.error.config' }] }]);
|
||||
}
|
||||
|
||||
const items = Service.getItems(model);
|
||||
|
||||
|
@ -35,12 +35,13 @@ module.exports = function() {
|
||||
'strapi'
|
||||
);
|
||||
|
||||
let strapi;
|
||||
if (isLocalStrapiValid(localStrapiPath, process.cwd())) {
|
||||
strapi = require(localStrapiPath);
|
||||
} else {
|
||||
strapi = require('strapi');
|
||||
}
|
||||
const strapi = function () {
|
||||
try {
|
||||
return require(path.resolve(process.cwd(), 'node_modules', 'strapi'));
|
||||
} catch (e) {
|
||||
return require('strapi');
|
||||
}
|
||||
}();
|
||||
|
||||
// Set NODE_ENV
|
||||
if (_.isEmpty(process.env.NODE_ENV)) {
|
||||
|
@ -16,7 +16,7 @@ module.exports = function() {
|
||||
const cwd = '';
|
||||
|
||||
// Load configurations.
|
||||
glob('./node_modules/strapi-*', {}, (err, files) => {
|
||||
glob('./node_modules/strapi-*', { ignore: ['./node_modules/strapi-plugin-*'] }, (err, files) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ module.exports = {
|
||||
try {
|
||||
return require(path.resolve(this.config.appPath, url));
|
||||
} catch (e) {
|
||||
this.log.error(e);
|
||||
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user