'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _chalk = require('chalk');

var _chalk2 = _interopRequireDefault(_chalk);

var _printTools = require('../../utils/print-tools');

var _dateUtils = require('../../utils/date-utils');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function printCompileError(errObj, socketName) {
  if (errObj.errorType === 'compilationError') {
    if (socketName) {
      (0, _printTools.echo)(7)(`${_chalk2.default.red('deploy error:')} ${(0, _dateUtils.currentTime)()} ${_chalk2.default.cyan(socketName)} socket`);
    }
    (0, _printTools.echo)();
    (0, _printTools.error)(14)(`${errObj.error.message}`);
    (0, _printTools.echo)();
    (0, _printTools.echo)(14)(`${errObj.error.codeFrame.split('\n').join(`\n${(0, _printTools.p)(14)()}`)}`);
    (0, _printTools.echo)();
  }
}

exports.default = {
  printCompileError
};
module.exports = exports['default'];
//# sourceMappingURL=print.js.map