Display errors from back end on Accounts page in crouton
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Mon, 10 Apr 2017 19:08:14 +0000 (15:08 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Mon, 10 Apr 2017 19:08:14 +0000 (15:08 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/accounts/src/account/account.jsx
skyquake/plugins/accounts/src/account/accountSource.js

index b7dbf35..4f011cb 100644 (file)
@@ -106,8 +106,8 @@ class Account extends React.Component {
             self.props.router.push({pathname:'accounts'});
             self.props.flux.actions.global.hideScreenLoader.defer();
         },
-         function() {
-            self.props.flux.actions.global.showNotification("There was an error creating your account. Please contact your system administrator.");
+         function(error) {
+            self.props.flux.actions.global.showNotification(error);
             self.props.flux.actions.global.hideScreenLoader.defer();
          });
     }
index 52af857..45da0fb 100644 (file)
@@ -50,6 +50,7 @@ module.exports = function(Alt) {
               }).fail(function(xhr){
                 //Authentication and the handling of fail states should be wrapped up into a connection class.
                 Utils.checkAuthentication(xhr.status);
+                reject(xhr.responseText || 'An error occurred. Check your logs for more information');
               });;
             });
           },
@@ -133,7 +134,7 @@ module.exports = function(Alt) {
               }).fail(function(xhr){
                 //Authentication and the handling of fail states should be wrapped up into a connection class.
                 Utils.checkAuthentication(xhr.status);
-                reject();
+                reject(xhr.responseText || 'An error occurred. Check your logs for more information');
               });
 
             });
@@ -177,7 +178,7 @@ module.exports = function(Alt) {
               }).fail(function(xhr){
                 //Authentication and the handling of fail states should be wrapped up into a connection class.
                 Utils.checkAuthentication(xhr.status);
-                reject('error');
+                reject(xhr.responseText || 'An error occurred. Check your logs for more information');
               });
 
             });
@@ -204,7 +205,7 @@ module.exports = function(Alt) {
               }).fail(function(xhr){
                 //Authentication and the handling of fail states should be wrapped up into a connection class.
                 Utils.checkAuthentication(xhr.status);
-                reject('error');
+                reject(xhr.responseText || 'An error occurred. Check your logs for more information');
               });
             })
           },