@deveodk/vue-error-tracker

Give your users an easy way to see when something in your application goes wrong. This package makes it easy to show error messages.
529 7
Install
npm install @deveodk/vue-error-tracker
Latest Version:1.1.0
Vue:2
Older releases:1
License:MIT
Last Updated:Aug 29, 2017
Links: GitHub  ·  npm
Maintainer: deveodk

@deveodk/vue-error-tracker

npm vue2

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

npm install --save @deveodk/vue-error-tracker

Bundler (Webpack, Rollup)

import Vue from 'vue'
import vueErrorTracker from '@deveodk/vue-error-tracker'
Vue.use(vueErrorTracker)

Browser

<!-- From CDN -->
<script src="https://unpkg.com/@deveodk/vue-error-tracker/dist/@deveodk/vue-error-tracker.min.js"></script>

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 drivers

The package is compatible with vue-resource and axios out of the box

# You can notify on as many http status codes as your like, 
just include them in the HttpErrorCodes object

import 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

# 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

Related Packages

@deveodk/vue-online

An easy way to show if a users browser is online, with support for custom notifi...

1,682 4
vue-json-tree-view

a JSON Tree View Component in Vue.js

380,792 473
@v-c/picker

picker ui component for vue

57,185 32
vue-frame-crm

vue components for crm system

15,005
kokk

A beautiful way to create a documentation from markdown, and insert a vue compon...

10,142 49

Version History

Version Released Vue License
1.1.0 ^2.3.0 MIT
1.0.5 ^2.3.0 MIT
1.0.4 ^2.3.0 MIT
1.0.3 ^2.3.0 MIT
1.0.2 ^2.3.0 MIT