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

Commit c24f5fb

Browse files
committed
Handle network failure and give proper error message
1 parent a5d23f8 commit c24f5fb

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

client/src/components/SchemaView.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ export default {
605605
if (e.response.data.message) {
606606
this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
607607
} else {
608-
this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
608+
this.$Notice.error({title: 'Error', desc: e.message})
609609
}
610610
})
611611
} else {
@@ -655,11 +655,11 @@ export default {
655655
}, 1000)
656656
})
657657
.catch((err) => {
658+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
658659
setTimeout(() => {
659660
this.sendDataEmail = this.$refs.schemasubformview.$el.outerHTML
660661
this.email = true
661662
this.loadEmail = false
662-
console.log(err)
663663
}, 1000)
664664
})
665665
} else {
@@ -769,7 +769,7 @@ export default {
769769
this.validErr = []
770770
this.isEmailDone = false
771771
}).catch(err => {
772-
console.log('Error', err)
772+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
773773
this.$Loading.finish()
774774
this.bLoading = false
775775
this.email = false
@@ -934,7 +934,7 @@ export default {
934934
.then((res) => {
935935
return (res.data.data[0])
936936
}).catch(err => {
937-
console.log('Error: ', err)
937+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
938938
this.dataLoading = false
939939
return
940940
})
@@ -944,7 +944,7 @@ export default {
944944
return schemaModel.getAll(this.flowzData.schema).then(res => {
945945
return res
946946
}).catch(err => {
947-
console.log('Error: ', err)
947+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
948948
this.dataLoading = false
949949
return
950950
})
@@ -990,7 +990,7 @@ export default {
990990
this.$Loading.finish()
991991
}
992992
}).catch(err => {
993-
console.error('Error: ', err)
993+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
994994
this.$Loading.error()
995995
this.dataLoading = false
996996
})

client/src/components/emailtemplate.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h2 class="heading">Templates</h2>
55
<Table border highlight-row :columns="columns7" class="tableCss" :data="data6"></Table>
66
</div>
7-
<div class="editor" v-if="newTemplate">
7+
<div class="editor" v-if="newTemplate && flag">
88
<h2 class="heading">Create Template</h2>
99
<keep-alive>
1010
<editor v-model="GetHtmlOfEditor" api-key="ppzi01crrfo3pvd43s3do89pguwkhowrwajpjdqdkginzj7k" :toolbar="toolbar1" :plugins="plugins" :init="settings" :initial-value="gethtmlcontent"></editor>
@@ -29,6 +29,7 @@ import _ from 'lodash'
2929
export default {
3030
data () {
3131
return {
32+
flag: false,
3233
updateTemplateid: '',
3334
newTemplate: true,
3435
templateName: '',
@@ -179,10 +180,12 @@ export default {
179180
'user': this.$store.state.user._id
180181
})
181182
.then((res) => {
183+
this.flag = true
182184
this.data6 = res.data.data
183185
})
184186
.catch((err) => {
185187
console.log(err)
188+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
186189
})
187190
},
188191
feathers: {

client/src/pages/Login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default {
145145
if (error.response) {
146146
this.$Message.error(error.response.data)
147147
} else {
148-
this.$Message.error('Fail login.')
148+
this.$Message.error(error.message)
149149
}
150150
return
151151
})

client/src/pages/Register.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export default {
9999
}
100100
})
101101
.catch(e => {
102-
this.$Message.error(e.response.data)
103102
this.loading = false
103+
this.$Message.error(e.message)
104104
})
105105
} else {
106106
this.$Message.error('Form validation failed!')

client/src/pages/flow/List.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ export default {
719719
})
720720
.catch(error => {
721721
this.loading = false
722-
this.$Notice({duration: '3', title: 'Network Error', desc: ''})
722+
this.$Notice.error({duration: '3', title: error.message, desc: ''})
723723
console.log(error)
724724
})
725725
},

client/src/pages/schema/schemaList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
return res.data.data
194194
}).catch(err => {
195195
console.log(err)
196+
this.$Notice.error({duration: '3', title: err.message, desc: ''})
196197
this.loading = false
197198
return []
198199
}))

0 commit comments

Comments
 (0)