From 79a7b3c9853d99fad4ef4b71cf6ab3b16204e141 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Mon, 18 Nov 2019 22:20:18 +0530 Subject: [PATCH] :seedling: Error handlers --- pages/graphql.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pages/graphql.vue b/pages/graphql.vue index 533b56c20..6e2abadc2 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -54,6 +54,7 @@ export default { methods: { getSchema() { const startTime = Date.now(); + this.schemaString = "Loading..."; // Start showing the loading bar as soon as possible. // The nuxt axios module will hide it when the request is made. @@ -73,6 +74,14 @@ export default { this.$toast.info(`Finished in ${duration}ms`, { icon: "done" }); + }) + .catch(error => { + this.$nuxt.$loading.finish(); + this.schemaString = error + ". Check console for details."; + this.$toast.error(error + " (F12 for details)", { + icon: "error" + }); + console.log('Error', error); }); } }