Show EJ: Unhandler - creates bug reports for uncaught exceptions and unhandled rejections

栏目: IT技术 · 发布时间: 5年前

内容简介:Creates bug reports for uncaught exceptions and unhandled rejections. Works like a DYI Sentry client. Can publish bug reports on different trackers simultaneously.Registers event handlers for

unhandler

Creates bug reports for uncaught exceptions and unhandled rejections. Works like a DYI Sentry client. Can publish bug reports on different trackers simultaneously.

Install

$ npm install @tuplo/unhandler

# or with yarn
$ yarn add @tuplo/unhandler

Usage

import { unhandler } from '@tuplo/unhandler';

Registers event handlers for uncaughtException and unhandledRejection

unhandler({
  appName: 'my-app-1',
  providers: {
    github: {
      user: 'tuplo',
      repo: 'unhandler',
      token: 'secret-token-xxxxxxx',
    },
  },
});

throw new Error('buggy bug');

// will create a GitHub issue with title "[my-app-1] buggy bug"

Creates bug reports directly with submitError

import { submitError } from '@tuplo/unhandler';

const error = new Error('buggy bug');

await submitError(error, {
  appName: 'my-app-1',
  providers: {
    github: {
      user: 'tuplo',
      repo: 'unhandler',
      token: 'secret-token-xxxxxxx',
    },
  },
});

// will create a GitHub issue with title "[my-app-1] buggy bug"

Error tracking providers

  • GitHub Issues
  • Trello
  • JIRA

API

unhandler(options)

options

appName: string

The name of the application triggering the error.

providers: Provider[]

GitHub

name type description
user string The user or organization, owner of the repository where issues will be created.
repo string The name of the repository where issues will be created.
token string GitHub's personal access token with a repo scope.

Contribute

Contributions are always welcome!

License

MIT


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

奇点系列

奇点系列

彼得•蒂尔、里德•霍夫曼、本•霍洛维茨、埃里克•杰克逊等 / 高玉芳、路蒙佳、杨晓红、徐彬等 / 中信出版社 / 2015-6-20 / 182.00

1.硅谷创投教父、PayPal创始人彼得•蒂尔、LinkedIn创始人里德•霍夫曼、创业导师本•霍洛维茨、“PayPal黑帮”初创成员埃里克•杰克逊联合作品。 2.彼得•蒂尔与埃隆•马斯克的首次交锋,PayPal从0到1改变全球金融的生死突围,商业硬汉的创业史诗,揭秘“PayPal黑帮”的创业维艰与联盟关系。 3.《人民日报》推荐创业者必读书目!“奇点系列”的作者们以及“PayPal黑......一起来看看 《奇点系列》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具