<commit_before>'use strict';

const WatcherNonInterruptibleError = require('shark-watcher').NonInterruptibleError;
const Transformer   = require('shark-transformer');
const autoprefixer  = require('autoprefixer-core');
const extend        = require('node.extend');
const co            = require('co');
const VError        = require('verror');

module.exports = Transformer.extend({
	renderAutoprefixer: function(css, prefixes) {
		try {
			return autoprefixer({
				browsers: prefixes
			}).process(css).css;
		}
		catch (error) {
			throw new WatcherNonInterruptibleError(error, 'Autoprefixer error');
		}
	},

	transformTree: function *() {
		return this.tree.forEachDestSeries(co.wrap(function *(destPath, srcCollection, done) {
			try {
				yield this.transformTreeConcreteDest(destPath, srcCollection);
				done();
			}
			catch (error) {
				done(new VError(error, 'transformTree'));
			}
		}.bind(this)));
	},

	transformTreeConcreteDest: function *(destPath, srcCollection) {
		try {
			srcCollection.forEach(function(srcFile) {
				var autoprefixed = this.renderAutoprefixer(
					srcFile.getContent(),
					srcCollection.getOptions().browsers
				);
				srcFile.setContent(autoprefixed);
			}.bind(this));
		}
		catch (error) {
			throw new VError(error, 'renderTreeDest');
		}
	},

	treeToTree: function *() {
		yield this.tree.fillContent();
		yield this.transformTree();

		return this.tree;
	}
});<commit_msg>Remove useless try/catch<commit_after>'use strict';

const WatcherNonInterruptibleError = require('shark-watcher').NonInterruptibleError;
const Transformer   = require('shark-transformer');
const autoprefixer  = require('autoprefixer-core');
const extend        = require('node.extend');
const co            = require('co');
const VError        = require('verror');

module.exports = Transformer.extend({
	renderAutoprefixer: function(css, prefixes) {
		try {
			return autoprefixer({
				browsers: prefixes
			}).process(css).css;
		}
		catch (error) {
			throw new VError(error, 'Autoprefixer error');
		}
	},

	transformTree: function *() {
		return this.tree.forEachDestSeries(co.wrap(function *(destPath, srcCollection, done) {
			try {
				yield this.transformTreeConcreteDest(destPath, srcCollection);
				done();
			}
			catch (error) {
				done(new VError(error, 'transformTree'));
			}
		}.bind(this)));
	},

	transformTreeConcreteDest: function (destPath, srcCollection) {
		srcCollection.forEach(function(srcFile) {
			var autoprefixed = this.renderAutoprefixer(
				srcFile.getContent(),
				srcCollection.getOptions().browsers
			);
			srcFile.setContent(autoprefixed);
		}.bind(this));
	},

	treeToTree: function *() {
		yield this.tree.fillContent();
		yield this.transformTree();

		return this.tree;
	}
});
{'fraction_non_alphanumeric': 0.1383327266108482, 'fraction_numerical': 0.0, 'mean_word_length': 4.194706994328922, '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': '3806923', 'n_tokens_mistral': 994, 'n_tokens_neox': 880, 'n_words': 161}