From 0c5d3b49eb9c3847c8cfedfd400a931356354d97 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Wed, 2 Nov 2016 08:07:54 -0400 Subject: [PATCH] RIFT-14970: Display RPC error on instantiation if present Signed-off-by: Laurence Maultsby --- .../plugins/launchpad/src/instantiate/instantiateStore.js | 6 +++--- .../launchpad/src/instantiate/launchNetworkServiceSource.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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); -- 2.25.1