diff --git a/frontend/src/pages/wiki2/utils/index.js b/frontend/src/pages/wiki2/utils/index.js index 2c66af24721..761dc3d083d 100644 --- a/frontend/src/pages/wiki2/utils/index.js +++ b/frontend/src/pages/wiki2/utils/index.js @@ -111,6 +111,9 @@ const getPaths = (navigation, currentPageId, pages, isGetPathStr) => { const getNamePaths = (config, pageId) => { const { navigation, pages } = config; const { paths, curNode } = getPaths(navigation, pageId, pages, true); + if (!paths || !curNode) { + return { path: null, isDir: false }; + } const pathArr = paths.split('-'); const nameArr = []; if (pathArr.length > 1) { diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js index d9fd1cf13d5..5f92a385dad 100644 --- a/frontend/src/utils/utils.js +++ b/frontend/src/utils/utils.js @@ -1399,7 +1399,13 @@ export const Utils = { errorMsg = gettext('Error'); } } else { - errorMsg = gettext('Please check the network.'); + if (typeof error === 'object' && error.name) { + errorMsg = error.name; + } else { + errorMsg = gettext('Please check the network.'); + } + // eslint-disable-next-line + console.log(error); } return errorMsg; },