Log errors (and optionally notify with a system notification)
Throws if gulp-task-maker is in strict mode
@param {object} err
485223
function showError(err) {
  if (!err) return
  const message =
    typeof err === 'string' ? err : err.message || err.formatted || ''
  const plugin = err.plugin || 'gulp-task-maker'

  // Show system notification
  if (!err.warn && options.notify) {
    const where = path.basename(process.cwd())
    notifier.notify({
      title: `${where}: ${plugin} error`,
      message: message.replace(/\s*\n+\s*/g, '\n')
    })
  }

  // Throw or log in console
  if (options.strict) throw err
  else customLog(`${plugin} error: ${message}`)
}
765857
function error(error) {

  const line = error.loc ? error.loc.line : (error.line ? error.line : 'Unknown');
  const file = (error.fileName ? error.fileName : (error.file ? error.file : (error.relativePath ? error.relativePath : ''))).replace(process.cwd(), '');
  const path = error.relativePath || 'path';
  const task = error.plugin || 'Task unknown';
  const name = error.name || 'Name unknown';

  // Easy error reporting

  if ( options.popups ) {
    notify({
      icon: options.error,
      title: name,
      subtitle: options.project,
      message: `Line ${line} in ${file}`,
    }).write(error);
  }

  let message = `${name} in ${file}: ${" line " + line + " "} \n ${error.message ? error.message.replace(process.cwd(), '') : error.toString()}`

  log(task + " Error", message)

  // Prevents any watchers from stopping
  this.emit('end');

}
838606
function onError (err) {
  console.error(chalk.red('✗ error:'), chalk.red(err.message))
  notifier.notify({
    title: 'Build failed:',
    message: err.message
  })
  this.emit('end')

  // When running without watch, process.exit(1) on error
  if (!watchifyEnabled) {
    process.exit(1)
  }
}
56609
function (err) {
		if (this.jobs.length) {
			var job = this.jobs.shift();
			try {
				job(err, this);
			} catch (e) {
				this.next(e);
			}
		} else {
			this.running = false;
		}
	}
508414
function handleError (task) {
  return function (err) {
    console.log(chalk.red(err));
    notify.onError(task + ' failed, check the logs..')(err);
  };
}
977732
function printErrors(summary, errors) {
  logError(`${summary}\n`);

  errors.forEach(err => {
    logError(`\t- ${err.message || err}`);
  });

  console.log();
}
60341
def strict_err_or_warn(self, *args, **kwargs):
        """"""
        if self.strict:
            raise self.make_err(CoconutStyleError, *args, **kwargs)
        else:
            logger.warn_err(self.make_err(CoconutSyntaxWarning, *args, **kwargs))
912785
function logEvents(gulpInst) {

  // Exit with 0 or 1
  var failed = false;
  process.once('exit', function(code) {
    if (code === 0 && failed) {
      exit(1);
    }
  });

  // Total hack due to poor error management in orchestrator
  gulpInst.on('err', function() {
    failed = true;
  });

  gulpInst.on('task_start', function(e) {
    // TODO: batch these
    // so when 5 tasks start at once it only logs one time with all 5
    log.info('Starting', '\'' + ansi.cyan(e.task) + '\'...');
  });

  gulpInst.on('task_stop', function(e) {
    var time = prettyTime(e.hrDuration);
    log.info(
      'Finished', '\'' + ansi.cyan(e.task) + '\'',
      'after', ansi.magenta(time)
    );
  });

  gulpInst.on('task_err', function(e) {
    var msg = formatError(e);
    var time = prettyTime(e.hrDuration);
    log.error(
      '\'' + ansi.cyan(e.task) + '\'',
      ansi.red('errored after'),
      ansi.magenta(time)
    );
    log.error(msg);
  });

  gulpInst.on('task_not_found', function(err) {
    log.error(
      ansi.red('Task \'' + err.task + '\' is not in your gulpfile')
    );
    log.error('Please check the documentation for proper gulpfile formatting');
    exit(1);
  });
}
661317
function (task) {
  return function (err) {
    notify.onError({
      message: task + ' failed, check the logs',
      sound: false
    })(err);
    gutil.log(gutil.colors.bgRed(task + ' error:'), gutil.colors.red(err));
  };
}
217519
function logError(terminal: Terminal, format: string, ...args: Array<mixed>): void {
  const str = util.format(format, ...args);
  terminal.log('%s: %s', chalk.red('error'), str);
}
1352517
function(err, changes) {
          if(cleaner.called) {
            return;
          }

          cleaner.called = true;
          if(err) {
            // Build a custom extra object, with hydration error details
            var extra = JSON.parse(JSON.stringify(task));
            extra.changes = changes;
            extra.stdout = stdout;
            extra.stderr = stderr;

            logError(err, extra);
            child.reset();
          }
          else {
            // Make the child available again
            child.available = true;
          }

          cb(err, changes);

          if(stdout !== "") {
            loggingTask.std = "out";
            log.info(loggingTask, stdout);
          }
          if(stderr !== "") {
            loggingTask.std = "err";
            log.info(loggingTask, stderr);
          }
          clearTimeout(timeout);
        }
206333
function err(...messages) {
  console.error(...messages);
  const p = document.createElement('p');
  p.innerText = messages.join(' ');
  p.style = 'color: red';
  logElement.appendChild(p);
}
539403
function log(err) {
    if (_logger) {
      if (typeof(err) == 'string') {
        err = { message: err, code: 0 }
      }
      _logger(err);
    }
  }
754296
function log(isError, message, data){
    var indentifier = 'cacheService: ';
    if(self.verbose || isError){
      if(data) {
        console.log(indentifier + message, data);
      } else {
        console.log(indentifier + message);
      }
    }
  }
75133
function error(err, req, res, next) {
  // log it
  if (!test) console.error(err.stack);

  // respond with 500 "Internal Server Error".
  res.status(500);
  res.send('Internal Server Error');
}
169145
function onError(err) {
    const ctx = this.$ctx;
    const cn = npm.utils.getSafeConnection(ctx.cn);
    npm.events.error(ctx.options, err, {cn, dc: ctx.dc});
    ctx.disconnect(err);
    if (ctx.cnOptions && typeof ctx.cnOptions.onLost === 'function' && !ctx.notified) {
        try {
            ctx.cnOptions.onLost.call(this, err, {
                cn,
                dc: ctx.dc,
                start: ctx.start,
                client: this
            });
        } catch (e) {
            npm.con.error(e && e.stack || e);
        }
        ctx.notified = true;
    }
}
785453
function fail(err, cbErr)
    {
      if(!err) return; // only catch errors
      log.warn('chat fail',err);
      chat.err = err;
      // TODO error inbox/outbox
      if(typeof cbErr == 'function') cbErr(err);
      readyUp(err);
    }