Skip to content

Commit ac2a91c

Browse files
committed
Improved error handling. Add trace of the call to the output
1 parent d869312 commit ac2a91c

File tree

1 file changed

+43
-9
lines changed

1 file changed

+43
-9
lines changed

src/pages/Index.vue

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@
188188

189189
<!-- Error dialog -->
190190
<q-dialog v-model="errorDialog">
191-
<q-card style="min-width: 500px" class="bg-negative text-vgrey">
191+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-negative text-vgrey">
192192
<q-card-section>
193193
<div class="text-h6">Error occured</div>
194194
</q-card-section>
195195
<q-card-section>
196-
{{ errorMessage }}
196+
<pre>{{ errorMessage }}</pre>
197197
</q-card-section>
198198
<q-card-actions align="right">
199199
<q-btn flat label="Got it" v-close-popup />
@@ -202,7 +202,7 @@
202202
</q-dialog>
203203
<!-- Result dialog -->
204204
<q-dialog v-model="resultDialog">
205-
<q-card style="min-width: 500px; max-width: 60vw;" class="bg-vgrey">
205+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
206206
<q-card-section>
207207
<div class="text-h6">Result</div>
208208
</q-card-section>
@@ -216,7 +216,7 @@
216216
</q-dialog>
217217
<!-- voted dialog -->
218218
<q-dialog v-model="votedDialog">
219-
<q-card style="min-width: 600px; max-width: 60vw;" class="bg-vgrey q-ma-sm">
219+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey q-ma-sm">
220220
<q-card-section>
221221
<div class="text-h6">Votes</div>
222222
</q-card-section>
@@ -251,7 +251,7 @@
251251
</q-dialog>
252252
<!-- Add node dialog -->
253253
<q-dialog v-model="addNodeDialog">
254-
<q-card style="min-width: 500px; max-width: 60vw;" class="bg-vgrey">
254+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
255255
<q-card-section>
256256
<div class="text-h6">Add the node into the distribution contract</div>
257257
</q-card-section>
@@ -269,7 +269,7 @@
269269
</q-dialog>
270270
<!-- register node dialog -->
271271
<q-dialog v-model="registerNodeDialog">
272-
<q-card style="min-width: 500px; max-width: 60vw;" class="bg-vgrey">
272+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
273273
<q-card-section>
274274
<div class="text-h6">Register the node into the voting contract</div>
275275
</q-card-section>
@@ -287,7 +287,7 @@
287287
</q-dialog>
288288
<!-- Private key update dialog -->
289289
<q-dialog v-model="privateDialog" @show="$refs.input.focus()">
290-
<q-card style="min-width: 500px" class="bg-vgrey">
290+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
291291
<q-card-section>
292292
<div class="text-h6">Enter your private key</div>
293293
</q-card-section>
@@ -310,7 +310,7 @@
310310
</q-dialog>
311311
<!-- Help dialog -->
312312
<q-dialog v-model="helpDialog">
313-
<q-card style="min-width: 700px; max-width: 60vw;" class="bg-vgrey">
313+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
314314
<q-card-section>
315315
<div class="text-h6">Help</div>
316316
</q-card-section>
@@ -345,7 +345,7 @@
345345
</q-dialog>
346346
<!-- Voting rules dialog -->
347347
<q-dialog v-model="rulesDialog">
348-
<q-card style="min-width: 700px; max-width: 60vw;" class="bg-vgrey">
348+
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
349349
<q-card-section>
350350
<div class="text-h6">Voting rules</div>
351351
</q-card-section>
@@ -477,6 +477,8 @@ export default {
477477
}
478478
} catch (error) {
479479
this.errorMessage = error
480+
this.errorMessage += '\n\n'
481+
this.errorMessage += error.stack
480482
this.errorDialog = true
481483
}
482484
} else {
@@ -499,6 +501,8 @@ export default {
499501
}
500502
} catch (error) {
501503
this.errorMessage = error
504+
this.errorMessage += '\n\n'
505+
this.errorMessage += error.stack
502506
this.errorDialog = true
503507
}
504508
} else {
@@ -522,6 +526,8 @@ export default {
522526
}
523527
} catch (error) {
524528
this.errorMessage = error
529+
this.errorMessage += '\n\n'
530+
this.errorMessage += error.stack
525531
this.errorDialog = true
526532
}
527533
} else {
@@ -541,6 +547,8 @@ export default {
541547
})
542548
} catch (error) {
543549
this.errorMessage = error
550+
this.errorMessage += '\n\n'
551+
this.errorMessage += error.stack
544552
this.errorDialog = true
545553
}
546554
},
@@ -569,6 +577,8 @@ export default {
569577
}
570578
} catch (error) {
571579
this.errorMessage = error
580+
this.errorMessage += '\n\n'
581+
this.errorMessage += error.stack
572582
this.errorDialog = true
573583
}
574584
},
@@ -589,6 +599,8 @@ export default {
589599
}
590600
} catch (error) {
591601
this.errorMessage = error
602+
this.errorMessage += '\n\n'
603+
this.errorMessage += error.stack
592604
this.errorDialog = true
593605
}
594606
} else {
@@ -616,6 +628,8 @@ export default {
616628
})
617629
} catch (error) {
618630
this.errorMessage = error
631+
this.errorMessage += '\n\n'
632+
this.errorMessage += error.stack
619633
this.errorDialog = true
620634
}
621635
} else {
@@ -648,6 +662,8 @@ export default {
648662
}
649663
} catch (error) {
650664
this.errorMessage = error
665+
this.errorMessage += '\n\n'
666+
this.errorMessage += error.stack
651667
this.errorDialog = true
652668
}
653669
} else {
@@ -664,6 +680,8 @@ export default {
664680
this.identity.balance = balance[0] ? balance[0] : '0 VTX'
665681
} catch (error) {
666682
this.errorMessage = error
683+
this.errorMessage += '\n\n'
684+
this.errorMessage += error.stack
667685
this.errorDialog = true
668686
}
669687
} else {
@@ -680,6 +698,8 @@ export default {
680698
this.identify(this.identity.public_key)
681699
} catch (error) {
682700
this.errorMessage = error
701+
this.errorMessage += '\n\n'
702+
this.errorMessage += error.stack
683703
this.errorDialog = true
684704
}
685705
},
@@ -712,6 +732,8 @@ export default {
712732
this.forceFileDownload(response)
713733
}).catch((error) => {
714734
this.errorMessage = error
735+
this.errorMessage += '\n\n'
736+
this.errorMessage += error.stack
715737
this.errorDialog = true
716738
})
717739
}
@@ -756,6 +778,8 @@ export default {
756778
this.refresh()
757779
} catch (error) {
758780
this.errorMessage = error
781+
this.errorMessage += '\n\n'
782+
this.errorMessage += error.stack
759783
this.errorDialog = true
760784
}
761785
},
@@ -787,6 +811,8 @@ export default {
787811
this.refresh()
788812
} catch (error) {
789813
this.errorMessage = error
814+
this.errorMessage += '\n\n'
815+
this.errorMessage += error.stack
790816
this.errorDialog = true
791817
}
792818
},
@@ -814,6 +840,8 @@ export default {
814840
}).catch((error) => {
815841
this.errorDialog = true
816842
this.errorMessage = error
843+
this.errorMessage += '\n\n'
844+
this.errorMessage += error.stack
817845
})
818846
})
819847
},
@@ -837,6 +865,8 @@ export default {
837865
}
838866
} catch (error) {
839867
this.errorMessage = error
868+
this.errorMessage += '\n\n'
869+
this.errorMessage += error.stack
840870
this.errorDialog = true
841871
}
842872
},
@@ -880,6 +910,8 @@ export default {
880910
} catch (error) {
881911
this.errorDialog = true
882912
this.errorMessage = error
913+
this.errorMessage += '\n\n'
914+
this.errorMessage += error.stack
883915
}
884916
},
885917
async retreiveReward () {
@@ -908,6 +940,8 @@ export default {
908940
setInterval(() => this.refresher(), 3000)
909941
} catch (error) {
910942
this.errorMessage = error
943+
this.errorMessage += '\n\n'
944+
this.errorMessage += error.stack
911945
this.errorDialog = true
912946
}
913947
}

0 commit comments

Comments
 (0)