From: Laurence Maultsby Date: Wed, 2 Nov 2016 12:07:54 +0000 (-0400) Subject: RIFT-14970: Display RPC error on instantiation if present X-Git-Tag: v1.0.1~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=0c5d3b49eb9c3847c8cfedfd400a931356354d97;p=osm%2FUI.git RIFT-14970: Display RPC error on instantiation if present Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index a2152307b..b13e242e1 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -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({ diff --git a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js index b4b717303..6c5daaafc 100644 --- a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js +++ b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js @@ -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);