How to use the signale.error function in signale

To help you get started, we’ve selected a few signale examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi-library / src / babel.ts View on Github external
through.obj((file, env, cb) => {
            try {
              file.contents = Buffer.from(
                transform({
                  file,
                  type,
                }),
              );
              // .jsx -> .js
              file.path = file.path.replace(extname(file.path), '.js');
              cb(null, file);
            } catch (e) {
              signale.error(`Compiled faild: ${file.path}`);
              cb(null);
            }
          }),
        ),
github phishy / wflow / lib / createWorkspace.js View on Github external
await mkdir(`${basePath}/data`, { recursive: true });
  } catch (e) {
    // logger.info(`${basePath}/data already existed. But that's ok`);
  }

  try {
    await mkdir(workPath, { recursive: true });
  } catch (e) {
    // logger.info(`workPath already existed. But that's ok`);
  }

  try {
    await mkdir(codePath, { recursive: true });
    await mkdir(logPath,  { recursive: true });
  } catch (e) {
    logger.error(e);
  }
  return {
    workPath,
    codePath,
    logPath
  };
}
github blurHY / HorizonSpider / App.js View on Github external
await crawler.crawl(modification)
                        } catch (e) {
                            if (e instanceof NAError) { // Not applicable stands for parameters not enough
                                signale.debug(`${siteInfo.address} - ${crawler_name} NA`)
                                return
                            }
                            signale.error(`An error appeared in ${crawler_name}`, e)
                        }
                    })()
                }
            }
        }
        await (new PromisePool(promiseGenerator, parseInt(process.env.Concurrency) || 3)).start()
        await DataBase.updateSite(modification, doc["_id"])
    } catch (e) {
        signale.error(`Unknown error in ${siteInfo.address}`, e)
    }
}
github youzan / vant / packages / vant-cli / src / commit-lint.js View on Github external
function commitLint() {
  const gitParams = process.env.HUSKY_GIT_PARAMS;
  const commitMsg = fs.readFileSync(gitParams, 'utf-8').trim();

  if (!commitRE.test(commitMsg)) {
    signale.error(`Error: invalid commit message: "${commitMsg}".

Proper commit message format is required for automated changelog generation.

Examples: 

- fix(Button): incorrect style
- feat(Button): incorrect style
- docs(Button): fix typo

Allowed Types:

- fix
- feat
- docs
- perf
- test
github phishy / wflow / lib / runJob.js View on Github external
fs.appendFile(`${job.path.logs}/${stepName}.log`, msg, err => {
        if (err) throw err;
        if (step.syslog.broadcasting) {
          return;
        }
        step.syslog.broadcasting = true;
        let cmd = `npx websocketdjs --port ${step.port} tail -f ${job.path.logs}/${stepName}.log`;
        logger.debug(cmd);
        try {
          execa.command(cmd), { shell: true };
        } catch (e) {
          logger.error("Failed to run websocketdjs");
          logger.error(cmd);
          logger.error(e);
          process.exit(1);
        }
      });
    });
github phishy / wflow / lib / getImage.js View on Github external
function getImage(job) {
  let imageMap = {
    "ubuntu-latest": "phishy/wflow-ubuntu-latest"
  };
  if (!(job["runs-on"] in imageMap)) {
    logger.error(`Unsupported runs-on in ${job.id} (ubuntu-latest only)`);
    process.exit(1);
  }
  return imageMap[job["runs-on"]];
}
github alibaba / GGEditor / scripts / start.js View on Github external
watcher.on('event', event => {
    const { code, error } = event;

    switch (code) {
      case 'START':
        signale.info('Rebuild since file changed');
        break;

      case 'ERROR':
        signale.error(error);

      default:
        break;
    }
  });
}
github marmelab / web-myna / src / myna.js View on Github external
res.end = function(chunk) {
        if (chunk) chunks.push(Buffer.from(chunk));

        const body = Buffer.concat(chunks).toString('utf8');
        try {
            const harContent = buildHar(req, res, body, apiCall, apiConfig.name);
            fs.writeFileSync(apiRecordPath, JSON.stringify(harContent, null, 2), {
                encoding: 'utf8',
            });
        } catch (error) {
            signale.error(error);
            signale.error(`Impossible to create .har from response to ${apiCall}`);
        }

        oldEnd.apply(res, arguments);
    };
github umijs / father / src / preCommit.ts View on Github external
runner.on('close', code => {
      if (code) {
        signale.error(`Error on execution: ${cmd} ${(args || []).join(' ')}`);
        reject(code);
        return;
      }
      resolve();
    });
  });