diff --git a/app/components/fastboot-only/local-navigation-for-seo.js b/app/components/fastboot-only/local-navigation-for-seo.js index 2b4605d81e5..1278e5dc769 100644 --- a/app/components/fastboot-only/local-navigation-for-seo.js +++ b/app/components/fastboot-only/local-navigation-for-seo.js @@ -8,7 +8,7 @@ export default Component.extend({ wikiVariables: service(), localLinks: readOnly('wikiVariables.localNav'), currentLocalLinks: or('currentLocalNav.children', 'localLinks'), - flattenLinksArray(linksList) { + flattenLinksArray(linksList = []) { let flatArray = []; linksList.forEach((item) => { if (item.href !== '#') { diff --git a/app/routes/application.js b/app/routes/application.js index fe2a47db49b..470c5ad2123 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -1,6 +1,7 @@ import {inject as service} from '@ember/service'; import Route from '@ember/routing/route'; import {getOwner} from '@ember/application'; +import {getWithDefault} from '@ember/object'; import Ember from 'ember'; import ArticleModel from '../models/wiki/article'; import HeadTagsStaticMixin from '../mixins/head-tags-static'; @@ -193,10 +194,9 @@ export default Route.extend( } this.get('logger').error('Application error', error); - if (fastboot.get('isFastBoot')) { fastboot.get('shoebox').put('serverError', true); - fastboot.set('response.statusCode', 503); + fastboot.set('response.statusCode', getWithDefault(error, 'code', 503)); this.injectScriptsFastbootOnly(null, transition.queryParams); // We can't use the built-in mechanism to render error substates.