From 3962f35905ad1903aa32a1a1030109e8b3f12c04 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 11 Aug 2020 17:57:22 +0100 Subject: [PATCH] ui: Passthrough any error from a route:application refresh (#8480) --- ui-v2/app/controllers/application.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui-v2/app/controllers/application.js b/ui-v2/app/controllers/application.js index 36aedf285..84baceed9 100644 --- a/ui-v2/app/controllers/application.js +++ b/ui-v2/app/controllers/application.js @@ -41,12 +41,19 @@ export default Controller.extend({ const container = getOwner(this); const routeName = this.router.currentRoute.name; const route = container.lookup(`route:${routeName}`); - // Refresh the application route + // Refresh the application route as everything including the main nav needs refreshing return container .lookup('route:application') .refresh() - .promise.then(res => { + .promise.catch(function(e) { + // passthrough + // if you are on an error page a refresh of the application route will reject + // thats ok as we then transition to the actual route you were trying + // to get to originally anyway + }) + .then(res => { // Use transitionable if we need to change a section of the URL + // or routeName and currentRouteName aren't equal (i.e. error page) if ( routeName !== this.router.currentRouteName || typeof params.nspace !== 'undefined'