<commit_before>var _gutil = require('gulp-util');
var _gplumber = require('gulp-plumber');

var PrettyError = (function(customErrorFormat){

    // custom error format function provided ?
    if (typeof customErrorFormat != 'undefined'){

        // proxy
        return _gplumber(function(error){
            customErrorFormat.apply(this, [error, _gutil]);
        });

    }else{
        // default appearance
        return _gplumber(function(error){
            // add indentation
            var msg = error.codeFrame.replace(/\n/g, '\n    ');

            _gutil.log('|- ' + _gutil.colors.bgRed.bold('Build Error in ' + error.plugin));
            _gutil.log('|- ' + _gutil.colors.bgRed.bold(error.message));
            _gutil.log('|- ' + _gutil.colors.bgRed('>>>'));
            _gutil.log('|\n    ' + msg + '\n           |');
            _gutil.log('|- ' + _gutil.colors.bgRed('<<<'));
        });
    }
});<commit_msg>Make sure it will not break with gulp-less<commit_after>var _gutil = require('gulp-util');
var _gplumber = require('gulp-plumber');

var PrettyError = (function(customErrorFormat){

    // custom error format function provided ?
    if (typeof customErrorFormat != 'undefined'){

        // proxy
        return _gplumber(function(error){
            customErrorFormat.apply(this, [error, _gutil]);
        });

    }else{
        // default appearance
        return _gplumber(function(error){
            // log the error message
            _gutil.log('|- ' + _gutil.colors.bgRed.bold('Build Error in ' + error.plugin));
            _gutil.log('|- ' + _gutil.colors.bgRed.bold(error.message));
            
            // make sure there is codeFrame in the error object.
            // gulp-less does not have it, so it will throw an error
            if(error.codeFrame != 'undefined') {
                // add indentation
                var msg = error.codeFrame.replace(/\n/g, '\n    ');
                
                _gutil.log('|- ' + _gutil.colors.bgRed('>>>'));
                _gutil.log('|\n    ' + msg + '\n           |');
                _gutil.log('|- ' + _gutil.colors.bgRed('<<<'));
            }
        });
    }
});
{'fraction_non_alphanumeric': 0.15821033210332103, 'fraction_numerical': 0.0, 'mean_word_length': 1.8728476821192053, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1734071', 'n_tokens_mistral': 662, 'n_tokens_neox': 639, 'n_words': 131}