<commit_before>let chalk = require('chalk');

module.exports = function (message) {
	return function(details) {
		console.log(chalk.red(message));

		if (details) {
			console.log();
			console.log(chalk.gray('Error details:'));
			console.log();
			console.log(details);
		}
	};<commit_msg>better error messages<commit_after>let chalk = require('chalk');

let errorMessages = {
	init: 'An error occurred while creating the application!',
	start: 'An error occurred while starting the application! Are you in a wrong folder, maybe?',
	build: 'An error occurred while building the application! Are you in a wrong folder, maybe?',
	deploy: 'An error occurred while deploying the application! Are you in a wrong folder, maybe?'
};

module.exports = function (type, details) {
	let message = errorMessages[type];

	console.log(chalk.red(message));

	if (details) {
		console.log();
		console.log(chalk.gray('Error details:'));
		console.log();
		console.log(details);
	}
{'fraction_non_alphanumeric': 0.13768115942028986, 'fraction_numerical': 0.0, 'mean_word_length': 4.896341463414634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3796971', 'n_tokens_mistral': 310, 'n_tokens_neox': 286, 'n_words': 91}