diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-01-05 10:41:15 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-01-12 14:38:26 -0500 |
commit | 2f0bbd3d1dcc24ae7cf3fdbaa0b8db7f60e365ba (patch) | |
tree | e7fd7835e5e78bbe819685c572a835697c5fd159 /app/assets/javascripts | |
parent | 3eebca7b5c8af599d4aec6f2b5b4905408079754 (diff) | |
download | gitlab-ce-2f0bbd3d1dcc24ae7cf3fdbaa0b8db7f60e365ba.tar.gz |
Adds .catch to the request in order to handle erros and show a feedback to the user
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/environments/components/environment.js.es6 | 7 |
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'); }); }, |