RIFT-14970: Display RPC error on instantiation if present
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
index a215230..b13e242 100644
--- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
+++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
@@ -184,9 +184,9 @@
}
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({
diff --git a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js
index b4b7173..6c5daaa 100644
--- a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js
+++ b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js
@@ -131,9 +131,10 @@
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);