RIFT-14970: Display RPC error on instantiation if present 91/591/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 2 Nov 2016 12:07:54 +0000 (08:07 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 2 Nov 2016 12:07:54 +0000 (08:07 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js

index a215230..b13e242 100644 (file)
@@ -184,9 +184,9 @@ class LaunchNetworkServiceStore {
     }
     launchNSRError(error) {
         var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information';
-        // if(error) {
-        //     msg = error;
-        // }
+        if(error) {
+            msg = error;
+        }
         Alt.actions.global.showNotification.defer(msg);
         Alt.actions.global.hideScreenLoader.defer();
         this.setState({
index b4b7173..6c5daaa 100644 (file)
@@ -131,9 +131,10 @@ export default function(Alt){
             var error;
             if(xhr.responseText) {
               try {
-                error = JSON.stringify(xhr.responseText);
+                error = JSON.parse(xhr.responseText);
+                error = JSON.parse(error.error)['rpc-reply']['rpc-error']['error-message'];
               } catch(e){
-
+                console.log(e);
               }
             }
             reject(error);