import instance from '@/main' import { parseErrorNotification, parseBlacklist } from '@/util/helpers' const errorUrlBlacklist = [ "/api/get-token/", ] const blackListRegExp = new RegExp(parseBlacklist(errorUrlBlacklist), "g") export function errorInterceptor (error: any): any { // TODO: log errors and store them somewhere if (error.response.request.responseURL.match(blackListRegExp)) { return } instance.$notify({ title: 'Request failed.', text: parseErrorNotification(error.response), type: 'error', duration: -1 }) return Promise.reject(error) }