[Axios] Error logger

This commit is contained in:
Matej Glasnák committed 2023-07-24 14:20:36 +02:00
1 parent 886a44229f
commit da63ed5ed2
1 file changed
+15 -2
+15 -2
View File
@@ -26,7 +26,7 @@ export class I18n {
postTranslation: this._postTranslation, postTranslation: this._postTranslation,
}) })
this.changeLanguage({title: "Slovenský", flag: "sk", value: "sk"}) this.changeLanguage({ title: "Slovenský", flag: "sk", value: "sk" })
this.initCurrentLanguage() this.initCurrentLanguage()
} }
@@ -76,6 +76,19 @@ export class I18n {
return config return config
}) })
// axios.interceptors.response.use(
// (response) => {
// return response
// },
// (error) => {
// axios.post('https://logger.wezeo.dev/api/v1/log', {
// data: JSON.stringify(error)
// })
// return Promise.reject(error)
// }
// );
} }
public _loadLocaleMessages(path = '@/locales') { public _loadLocaleMessages(path = '@/locales') {
@@ -91,7 +104,7 @@ export class I18n {
return {} return {}
} }
const messages: {[key: string]: {[key: string]: string}} = {} const messages: { [key: string]: { [key: string]: string } } = {}
locales.keys().forEach((key) => { locales.keys().forEach((key) => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i) const matched = key.match(/([A-Za-z0-9-_]+)\./i)