Skip to content
Snippets Groups Projects
Verified Commit d4dd5279 authored by BARBIER Marc's avatar BARBIER Marc
Browse files

added basic errors to Mining algorithm

parent a926ad68
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,15 @@ export default defineComponent({
form.append('id', '' + localStorage.getItem('datasetId'))
const response = await fetch('http://localhost:8080/rest/mining/mine', { method: 'POST', body: form })
if(response.status === 200) {
this.$toast.info(await response.text())
switchToNewestProject(this)
} else {
if(response.bodyUsed){
const data = await response.json()
this.$toast.error(data.message)
}else{
this.$toast.error('An error occurred, check the server logs for more details')
}
}
},
......@@ -81,7 +89,15 @@ export default defineComponent({
form.append('id', '' + localStorage.getItem('datasetId'))
const response = await fetch('http://localhost:8080/rest/mining/mine', { method: 'POST', body: form })
if(response.status === 200) {
this.$toast.info(await response.text())
switchToNewestProject(this)
} else {
if(response.bodyUsed){
const data = await response.json()
this.$toast.error(data.message)
}else{
this.$toast.error('An error occurred, check the server logs for more details')
}
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment