Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rturk/koa-error-slack
Send Koa errors to Slack
https://github.com/rturk/koa-error-slack
Last synced: 2 months ago
JSON representation
Send Koa errors to Slack
- Host: GitHub
- URL: https://github.com/rturk/koa-error-slack
- Owner: rturk
- License: mit
- Created: 2016-06-09T15:28:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T01:14:12.000Z (over 7 years ago)
- Last Synced: 2024-10-19T00:53:21.442Z (3 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-koa - koa-error-slack - 发送 Koa 错误到 Slack。 ![](https://img.shields.io/github/stars/rturk/koa-error-slack.svg?style=social&label=Star) ![](https://img.shields.io/npm/dm/koa-error-slack.svg?style=flat-square) (仓库 / 中间件)
README
# koa-error-slack
This Middleware detects errors in Koa Servers and sends messages to a Slack (via webhook).## How it works
The Middleware will listen to errors thrown from downstream components using try & catch. Once an error is detected a message containing error detail as well other relevant information (context, request and whenever possible response information) will be published to your Slack channel.The Middleware code is lightweight and is intended to be used in production environments. Slack is only instantiated/called when an error is detected.
Please note that this middleware will solely catch errors from downstream components, so in order to catch relevant errors it must be one of the first middleware installed the Koa initialization stack.
## Installation
```js
$ npm install koa-error-slack --save
```## Usage
```js
import errorToSlack from 'koa-error-slack';const app = new Koa();
app.use(errorToSlack("https://hooks.slack.com/services/my-webhook-channel");
```