Skip to content

Instantly share code, notes, and snippets.

@camwhite
Created June 25, 2019 03:08
Show Gist options
  • Save camwhite/4ac69e9cd0d885b45d48350fc295fb42 to your computer and use it in GitHub Desktop.
Save camwhite/4ac69e9cd0d885b45d48350fc295fb42 to your computer and use it in GitHub Desktop.
import axios from 'axios'
import {
init,
captureMessage,
Transports
} from '@sentry/browser'
class AxiosTransport extends Transports.BaseTransport {
async sendEvent(event) {
await axios.post(this.url, event)
return {
status: 'success'
}
}
}
export default {
created({ app }) {
init({
dsn: process.env.VUE_APP_SENTRY_DSN,
transport: AxiosTransport
})
},
routeError(context, error) {
captureMessage(error)
},
catchError(context, error) {
captureMessage(error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment