Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deveodk/vue-error-tracker
Vue error tracker keeps track of HTTP errors and runtime error provides an easy solution for tracking errors.
https://github.com/deveodk/vue-error-tracker
vue vue-resource
Last synced: about 1 month ago
JSON representation
Vue error tracker keeps track of HTTP errors and runtime error provides an easy solution for tracking errors.
- Host: GitHub
- URL: https://github.com/deveodk/vue-error-tracker
- Owner: Deveodk
- License: mit
- Created: 2017-02-15T12:44:24.000Z (over 7 years ago)
- Default Branch: version1.0
- Last Pushed: 2017-08-29T19:05:04.000Z (about 7 years ago)
- Last Synced: 2024-10-05T20:01:23.158Z (about 1 month ago)
- Topics: vue, vue-resource
- Language: JavaScript
- Homepage: https://packages.deveo.io/packages/vue/vue-error-tracker
- Size: 168 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm](https://img.shields.io/npm/v/@deveodk/vue-error-tracker.svg)](https://www.npmjs.com/package/@deveodk/vue-error-tracker) [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)
> Give your users an easy way to see when something in your application goes wrong. This package makes it easy to show error messages.
# Demo
See a functioning demo
deveo demo site## Installation
```bash
npm install --save @deveodk/vue-error-tracker
```### Bundler (Webpack, Rollup)
```js
import Vue from 'vue'
import vueErrorTracker from '@deveodk/vue-error-tracker'
Vue.use(vueErrorTracker)
```### Browser
```html
```
## Usage
The error tracker will automatically show a nice little toastr if you combine it with our @deveodk/vue-toastr.
However it is possible to write your own custom driversThe package is compatible with vue-resource and axios out of the box
```js
// You can notify on as many http status codes as your like,
just include them in the HttpErrorCodes objectimport errorTracker from '@deveodk/vue-error-tracker'
Vue.use(errorTracker, {
HttpDriver: require('@deveodk/vue-error-tracker/drivers/http/axios.js'),
NotificationDriver: require('@deveodk/vue-error-tracker/drivers/notification/deveoToastr.js'),
// Sentry.io optional
// ReportDriver: require('@deveodk/vue-error-tracker/drivers/report/sentry.js'),
HttpErrorCodes: {
400: {
title: 'Unknown error',
message: 'Something went wrong',
type: 'error'
},
500: {
title: 'Server error',
message: 'Ohh no something went wrong',
type: 'error'
}
}
})
```## Reporting errors
You can report the errors through the error drivers. The error tracker comes with built in support for sentry.io```js
// Sentry raven example
import Raven from 'raven-js'
import RavenVue from 'raven-js/plugins/vue'
Raven
.config(KEY HERE)
.addPlugin(RavenVue, Vue)
.install()
Vue.prototype.$raven = Raven// The error tracker will now automaticly report the errors to sentry
```## License
[MIT](http://opensource.org/licenses/MIT)