Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Handle network failure and give proper error message #525

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions client/src/components/SchemaView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export default {
if (e.response.data.message) {
this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
} else {
this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
this.$Notice.error({title: 'Error', desc: e.message})
}
})
} else {
Expand Down Expand Up @@ -655,11 +655,11 @@ export default {
}, 1000)
})
.catch((err) => {
this.$Notice.error({duration: '3', title: err.message, desc: ''})
setTimeout(() => {
this.sendDataEmail = this.$refs.schemasubformview.$el.outerHTML
this.email = true
this.loadEmail = false
console.log(err)
}, 1000)
})
} else {
Expand Down Expand Up @@ -769,7 +769,7 @@ export default {
this.validErr = []
this.isEmailDone = false
}).catch(err => {
console.log('Error', err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
this.$Loading.finish()
this.bLoading = false
this.email = false
Expand Down Expand Up @@ -934,7 +934,7 @@ export default {
.then((res) => {
return (res.data.data[0])
}).catch(err => {
console.log('Error: ', err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
this.dataLoading = false
return
})
Expand All @@ -944,7 +944,7 @@ export default {
return schemaModel.getAll(this.flowzData.schema).then(res => {
return res
}).catch(err => {
console.log('Error: ', err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
this.dataLoading = false
return
})
Expand Down Expand Up @@ -990,7 +990,7 @@ export default {
this.$Loading.finish()
}
}).catch(err => {
console.error('Error: ', err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
this.$Loading.error()
this.dataLoading = false
})
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/emailtemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 class="heading">Templates</h2>
<Table border highlight-row :columns="columns7" class="tableCss" :data="data6"></Table>
</div>
<div class="editor" v-if="newTemplate">
<div class="editor" v-if="newTemplate && flag">
<h2 class="heading">Create Template</h2>
<keep-alive>
<editor v-model="GetHtmlOfEditor" api-key="ppzi01crrfo3pvd43s3do89pguwkhowrwajpjdqdkginzj7k" :toolbar="toolbar1" :plugins="plugins" :init="settings" :initial-value="gethtmlcontent"></editor>
Expand All @@ -29,6 +29,7 @@ import _ from 'lodash'
export default {
data () {
return {
flag: false,
updateTemplateid: '',
newTemplate: true,
templateName: '',
Expand Down Expand Up @@ -179,10 +180,12 @@ export default {
'user': this.$store.state.user._id
})
.then((res) => {
this.flag = true
this.data6 = res.data.data
})
.catch((err) => {
console.log(err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
})
},
feathers: {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {
if (error.response) {
this.$Message.error(error.response.data)
} else {
this.$Message.error('Fail login.')
this.$Message.error(error.message)
}
return
})
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export default {
}
})
.catch(e => {
this.$Message.error(e.response.data)
this.loading = false
this.$Message.error(e.message)
})
} else {
this.$Message.error('Form validation failed!')
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/flow/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export default {
})
.catch(error => {
this.loading = false
this.$Notice({duration: '3', title: 'Network Error', desc: ''})
this.$Notice.error({duration: '3', title: error.message, desc: ''})
console.log(error)
})
},
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/schema/schemaList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
return res.data.data
}).catch(err => {
console.log(err)
this.$Notice.error({duration: '3', title: err.message, desc: ''})
this.loading = false
return []
}))
Expand Down