var BORSCHIK_CSS_TECH = require('borschik/lib/techs/css'),
    ROOLE = require('roole'),
    Q = require('q');

exports.API_VER = 2;

exports.techMixin = {

    getBuildResultChunk : function(relPath) {
        return '@import url(' + relPath + ');\n';
    },

    getBuildSuffixesMap : function() {
        return {
            'roole.css' : ['roo', 'css']
        };
    },

    processBuildResult : function(res) {
        var defer = Q.defer();

        ROOLE.compile(res, {
            filename : './',
            out : './',
            indent : '    ',
            prefixes : []
        }, function(err, res) {
            err?
                defer.reject(err) :
                defer.resolve([res]);
        });

        return defer.promise;
    },

    getBuildResult : function(filteredFiles, destSuffix, output, opts) {
        return this.__base.apply(this, arguments)
            .then(function(res) {
                var tech = new BORSCHIK_CSS_TECH.Tech({
                        comments : true,
                        freeze : false,
                        minimize : false
                    }),
                    file = new BORSCHIK_CSS_TECH.File(tech, output, 'include');

                file.content = file.parse(res.join(''));

                return this.processBuildResult(file.process(output));
            }.bind(this));
    }

};

@@ -628,53 +628,259 @@
     
-err?%0A                defer.reject(err) :%0A    
+if(err) %7B%0A                var e = new Error(err);%0A                if(typeof err.context === 'function') %7B%0A                    e.message += '%5Cn' + err.context();%0A                %7D%0A                defer.reject(e);%0A                return;%0A            %7D%0A%0A
     

add proper reports for roole compilation errors