Skip to content
Myr

error.js

This file

Path

lib/verbose/error.js

12 lines · 370 bytes · JavaScript

Last changed by

Add colors to `verbose` option (#893)ehmickybefore adoption281d504

History of this file

Take it

Add colors to `verbose` option (#893)ehmickybefore adoption281d504

line 1why, one step back
1import {redBright, yellowBright} from 'yoctocolors';

Print errors with verbose option (#890)ehmickybefore adoption209f78f

lines 2–4why, one step back
2import {verboseLog} from './log.js';
34// When `verbose` is `short|full`, print each command's error when it fails

Add colors to `verbose` option (#893)ehmickybefore adoption281d504

line 5why, one step back
5export const logError = ({message, failed, reject, verboseId, icon}) => {

Print errors with verbose option (#890)ehmickybefore adoption209f78f

lines 6–9why, one step back
6 if (!failed) {
7 return;8 }9

Add colors to `verbose` option (#893)ehmickybefore adoption281d504

lines 10–11why, one step back
10 const color = reject ? redBright : yellowBright;
11 verboseLog(message, verboseId, icon, color);

Print errors with verbose option (#890)ehmickybefore adoption209f78f

line 12why, one step back
12};