nuxt-testevia
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "nuxt-testevia", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Nuxt - Testevia Logger", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import axios from 'axios' | ||
const whichBrowser = () =>{ | ||
let test = (regexp) => regexp.test(window.navigator.userAgent); | ||
switch(true){ | ||
case test(/edge/i): return "Edge"; | ||
case test(/opr/i) && (!!window.opr || !!window.opera): return "Opera"; | ||
case test(/chrome/i) && !!window.chrome: return "Chrome"; | ||
case test(/trident/i) : return "Internet Explorer"; | ||
case test(/firefox/i) : return "Firefox"; | ||
case test(/safari/i): return "Safari"; | ||
default: return "Other"; | ||
} | ||
}; | ||
export default { | ||
errorHandler(options){ | ||
let self = this; | ||
return async function errorHandlerMiddleware(err, req, res, next) { | ||
await self.sendError(req.url, err, options) | ||
return function errorHandlerMiddleware(err, req, res, next) { | ||
self.sendError(req.url, err, options) | ||
return next(err); | ||
@@ -29,2 +42,6 @@ }; | ||
if(process.browser){ | ||
context.data['browser'] = whichBrowser(); | ||
} | ||
axios.post('https://testevia.broj42.com/api/log-errors/', context, {headers: {'Authorization': options.apiKey}}) | ||
@@ -31,0 +48,0 @@ .catch(e =>{ |
@@ -17,3 +17,2 @@ const path = require('path') | ||
module.exports.meta = require('../package.json') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2902
66