returnerrors.logError(newError('Could not locate a configuration file.'),process.cwd(),'Please check your deployment for config.js or config.example.js.');
returnerrors.logError(newError('Could not open config.example.js for read.'),process.cwd(),'Please check your deployment for config.js or config.example.js.');
returnerrors.logError(newError('Could not open config.js for write.'),process.cwd(),'Please check your deployment for config.js or config.example.js.');
errors.logError(newError('Cannot find the configuration for the current NODE_ENV'),"NODE_ENV="+envVal,'Ensure your config.js has a section for the current NODE_ENV value');
returnwhen.reject();
}
// Check that our url is valid
parsedUrl=url.parse(config.url||'invalid');
if(!parsedUrl.protocol||!parsedUrl.host){
errors.logError(newError('Your site url in config.js is invalid.'),config.url,'Please make sure this is a valid url before restarting');
returnwhen.reject();
}
// Check that we have database values
if(!config.database){
errors.logError(newError('Your database configuration in config.js is invalid.'),JSON.stringify(config.database),'Please make sure this is a valid Bookshelf database configuration');
errors.logError(newError('Your server values (host and port) in config.js are invalid.'),JSON.stringify(config.server),'Please provide them before restarting.');