Commit dda4daf6 authored by Janis Streib's avatar Janis Streib

FIX: more abstraction

parent 0b8f220e
Pipeline #118667 passed with stages
in 8 minutes and 46 seconds
......@@ -85,7 +85,12 @@ export default {
EventBus.$on('error', (payload) => {
window.console.debug('evbus trigger')
window.console.debug(payload)
self.global_error = JSON.stringify(payload, null, 4)
if ('response' in payload) {
self.global_error = payload.response.data
} else {
self.global_error = payload
}
self.global_error = JSON.stringify(self.global_error, null, 4)
this.$bvModal.show('net-suite-error')
})
}
......
......@@ -307,11 +307,7 @@ async function init() {
}
window.addEventListener('unhandledrejection', function (event) {
window.console.debug('unhanldedrejection handler triggered')
if ('response' in event.reason) {
EventBus.$emit('error', event.reason.response.data)
} else {
EventBus.$emit('error', event.reason)
}
EventBus.$emit('error', event.reason)
})
Axios.interceptors.response.use(
function (response) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment