Commit 2c3e7ee6 authored by janis.streib's avatar janis.streib 🦉
Browse files

FIX: correct index parsing for ta-errors

parent 0da95ae3
Pipeline #92689 passed with stages
in 7 minutes and 36 seconds
......@@ -186,7 +186,7 @@ const store = new Vuex.Store({
state.transaction_result = {
'type': 'error',
'error': e.response.data.exception,
'uuid': state.ta_list[e.response.data.exception.traceback[0].param['wapi.transaction_stmt.index']].uuid
'uuid': state.ta_list[APIUtil.getAPIErrorIndexFromDBException(e.response.data.exception)].uuid
}
window.localStorage.setItem('transaction_result', JSON.stringify(state.transaction_result))
}
......@@ -216,7 +216,7 @@ const store = new Vuex.Store({
state.transaction_result = {
'type': 'error',
'error': e.response.data.exception,
'uuid': state.ta_list[e.response.data.exception.traceback[0].param['wapi.transaction_stmt.index']].uuid
'uuid': state.ta_list[APIUtil.getAPIErrorIndexFromDBException(e.response.data.exception)].uuid
}
window.localStorage.setItem('transaction_result', JSON.stringify(state.transaction_result))
}
......
......@@ -38,5 +38,13 @@ export default {
res.push(app)
}
return res
},
getAPIErrorIndexFromDBException(e) {
for(let t of e.traceback) {
if('param' in t && 'wapi.transaction_stmt.index' in t.param) {
return t.param['wapi.transaction_stmt.index']
}
}
return -1
}
}
Supports Markdown
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