summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-01-05 10:41:15 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-01-12 14:38:26 -0500
commit2f0bbd3d1dcc24ae7cf3fdbaa0b8db7f60e365ba (patch)
treee7fd7835e5e78bbe819685c572a835697c5fd159
parent3eebca7b5c8af599d4aec6f2b5b4905408079754 (diff)
downloadgitlab-ce-2f0bbd3d1dcc24ae7cf3fdbaa0b8db7f60e365ba.tar.gz
Adds .catch to the request in order to handle erros and show a feedback to the user
-rw-r--r--app/assets/javascripts/environments/components/environment.js.es67
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/environments/components/environment.js.es6 b/app/assets/javascripts/environments/components/environment.js.es6
index 8b6fafb6104..80384ea8d72 100644
--- a/app/assets/javascripts/environments/components/environment.js.es6
+++ b/app/assets/javascripts/environments/components/environment.js.es6
@@ -1,6 +1,7 @@
-/* eslint-disable no-param-reassign */
+/* eslint-disable no-param-reassign, no-new */
/* global Vue */
/* global EnvironmentsService */
+/* global Flash */
//= require vue
//= require vue-resource
@@ -121,6 +122,10 @@
.then((json) => {
this.store.storeEnvironments(json);
this.isLoading = false;
+ })
+ .catch(() => {
+ this.isLoading = false;
+ new Flash('An error occurred while fetching the environments.', 'alert');
});
},