当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript bunyan.error函数代码示例

本文整理汇总了TypeScript中bunyan.error函数的典型用法代码示例。如果您正苦于以下问题:TypeScript error函数的具体用法?TypeScript error怎么用?TypeScript error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了error函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: errorHandler

 public errorHandler (err: Error) {
   switch (err.message) {
     case 'X-Hub-Signature does not match blob signature':
     case 'No X-Hub-Signature found on request':
       logger.error('Go to https://github.com/settings/apps/YOUR_APP and verify that the Webhook secret matches the value of the WEBHOOK_SECRET environment variable.')
       break
     case 'error:0906D06C:PEM routines:PEM_read_bio:no start line':
     case '{"message":"A JSON web token could not be decoded","documentation_url":"https://developer.github.com/v3"}':
       logger.error('Your private key (usually a .pem file) is not correct. Go to https://github.com/settings/apps/YOUR_APP and generate a new PEM file. If you\'re deploying to Now, visit https://probot.github.io/docs/deployment/#now.')
       break
     default:
       logger.error(err)
   }
 }
开发者ID:brntbeer,项目名称:probot,代码行数:14,代码来源:index.ts

示例2: callback

    waterline_obj.initialize(orm.config, (err, ontology) => {
        if (err != null)
            return callback(err);
        else if (ontology == null || ontology.connections == null || ontology.collections == null
            || ontology.connections.length === 0 || ontology.collections.length === 0) {
            logger.error('waterline_obj.initialize::ontology =', ontology, ';');
            return callback(new TypeError('Expected ontology with connections & waterline_collections'));
        }

        // Tease out fully initialised models.
        logger.info('Waterline initialised with:\t', Object.keys(ontology.collections), ';');
        return callback(null, { connection: ontology.connections, collections: ontology.collections });
    });
开发者ID:SamuelMarks,项目名称:restify-utils,代码行数:13,代码来源:index.ts

示例3: tweetImage

export default async function tweetImage(logger: Logger) {
  try {
    const { fileName, file } = await getRandomPicture();

    const b64Picture = file.toString('base64');
    const uploadedPicture = await t.post('media/upload', {
      stringify_ids: true,
      media_data: b64Picture,
    });
    const mediaParams = {
      stringify_ids: true,
      // @ts-ignore
      media_id: uploadedPicture.data.media_id_string,
      alt_text,
    };

    await t.post('media/metadata/create', mediaParams);
    const tweet = await t.post('statuses/update', {
      stringify_ids: true,
      status: config.twitter.tweetMessage,
      // @ts-ignore
      media_ids: [uploadedPicture.data.media_id_string],
    });

    logger.info({
      status: config.twitter.tweetMessage,
      // @ts-ignore
      mediaIds: uploadedPicture.data.media_id_string,
      image: fileName,
      // @ts-ignore
      tweet: tweet.data.id_str,
    });
  } catch (e) {
    logger.error(e);
  }
}
开发者ID:marudor,项目名称:randomCats,代码行数:36,代码来源:twitter.ts


注:本文中的bunyan.error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。