Skip to content

Commit

Permalink
Merge pull request #16 from pepfar-datim/cypress-ci-testing
Browse files Browse the repository at this point in the history
chore: modify nested menu message
  • Loading branch information
plinnegan authored Sep 25, 2024
2 parents 5f371fb + 75a2c3e commit 6f9bb8c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions render/src/nestedMenu/src/loadNestedMenu.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ export async function loadNestedMenu(content:string):Promise<string>{
initNestedMenu(nestedMenu)
return content.replace(menuRe, '<div id="nestedMenu"></div>')
} catch (e: any) {
const nestErrMsg = (content?: string) => `
<div id="nestedMenu">
<h4>Nested Menu Syntax Error</h4>
${content ? content : ''}
</div>
`
if ('message' in e) {
return content.replace(menuRe, `<div id="nestedMenu">There was an error with the nested menu syntax:\n${e.message}</div>`)
return content.replace(menuRe, nestErrMsg(e.message))
} else {
return content.replace(menuRe, '<div id="nestedMenu">There was an error parsing the nested menu syntax</div>')
return content.replace(menuRe, nestErrMsg())
}

}
}

0 comments on commit 6f9bb8c

Please # to comment.